I am developing an Android application using the phoneGap framework. In my application, I wanted to send an email. For this, I created a phoneGap plugin. In the plugin, I start working with email. The problem that I am facing is that I want to call some functions immediately after this operation is completed (by email). So how to achieve this.
The plugin method is as follows:
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 enable callback function for email activity. So the function is executed only when the activity is closed ... ??
Thanks in advance.
source share