Right now, I can send users to the compose email application, with a pre-filled email body containing the payment URL. This is done simply with an appropriate mailArgs object and a call to
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, mailArgs);
However, I notice that in the built-in web browser there is functionality to 'send address' which pops up a dialog asking what mechanism to use before sending the address. I would like to build something similar in my app. It seemed likely that the ContentHandler and Registry were used to build the 'send address' functionality, but the attempts I've made so far just get an exception saying "No ContentHandlers found"
static void launchPayURLEmail() {
Registry registry = Registry.getRegistry("<packagename><classname>");
Invocation inv = new Invocation();
inv.setType("text/plain");
String seed = "http://www.paypal.com";
inv.setAction(ContentHandler.ACTION_SEND);
inv.setData(seed.getBytes());
try {
registry.invoke(inv);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ContentHandlerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}