I’m developing an android app using phoneGap framework, In my app i wanted to send an e-mail,
For that i created a phoneGap-plugin.
In the plugin i am starting an email activity.
The problem i am facing here is , i want to call some functions right after that activity(e-mail) is ended.
So how to achieve this.??
the plugin method goes like this :
public PluginResult execute(String action, JSONArray args, String callbackId) {
try {
if (action.equals("startActivity")) {
Intent i=new Intent(action);
// code for email....
this.ctx.startActivity(i);
//call back function here ...???
return new PluginResult(PluginResult.Status.OK);
}catch (JSONException e) {
e.printStackTrace();
return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
}
So how to include a call back function for the e-mail activity.
So that the function is executed only when the activity is closed… ??
Thanks in advance..
Can’t you use the onActivityResult method just like you use for the camera intent for instance?
instead of starting the activity like
startActivity()
use startActivityForResult()
then you van override the onActivityResult() method