【发布时间】:2014-08-31 12:56:46
【问题描述】:
这是我的 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;
}
}
我希望你能帮助我。谢谢
【问题讨论】:
标签: android cordova cordova-plugins