queryCommand(new String[] { "app.contacts", "action.view" },
new String[] { CommandFrameworkDemo.EMAIL_ADDR },
context);
if (cmd != null) {
items.addElement(new CommandItem(
new StringProvider("View Contact"), null, cmd));
} else {
// Try the add contact command instead
cmd =
queryCommand(new String[] { "app.contacts", "action.add" },
new String[] { CommandFrameworkDemo.EMAIL_ADDR },
context);
if (cmd != null) {
items.addElement(new CommandItem(new StringProvider(
"Add Contact"), null, cmd));
}
}
return items;