如何在你的手机插件中获得你的上下文

这是我的Android插件,我的方法之一需要一个上下文,有没有办法如何获得这个上下文?

public class GaziruPlugin extends CordovaPlugin{ @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { String value = args.getString(0); BASE64Decoder decoder = new BASE64Decoder(); try { byte[] imageByte = decoder.decodeBuffer(value); Classlogic method = new Classlogic(); //this method requires a context type. method.DoLogic(context,imageByte); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return false; } 

}

我希望你能帮助我。 谢谢

尝试把这个插入到你的插件:

 Context context=this.cordova.getActivity().getApplicationContext();