} catch (final JSONException e) {
SendMenuDemo.errorDialog("JSONObject.put() threw " + e.toString());
}
// Query the SendCommandRepository for appropriate commands
final SendCommandRepository repository =
SendCommandRepository.getInstance();
final SendCommand[] sendCommands =
repository.get(SendCommand.TYPE_TEXT, context, true);
if (sendCommands != null) {
// Add submenu to the menu
menu.add(new SendCommandMenu(sendCommands, 0, 0));
}