I have written a CordavaPlugin derived class.
public class ShowMap extends CordovaPlugin {
@Override
public boolean execute(String action, JSONArray args,
CallbackContext callbackContext) throws JSONException {
if (action.compareTo("showMap") == 0)
{
String message = args.getString(0);
this.echo(message, callbackContext);
Intent i = new Intent();
return true;
}
return false;
}
private void echo(String message, CallbackContext callbackContext) {
if (message != null && message.length() > 0) {
callbackContext.success(message);
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
}
I want from this class to open a new activity.
How do I get access to the original context of the phonegap based class?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…