我正在尝试在我的插件中获取应用程序上下文,但它会抛出此错误:
无法在未调用的线程内创建处理程序 Looper.prepare()
这是我的代码:
ResourceManager manager = ResourceManager.getInstance(this, this.ctx.getApplicationContext());
我甚至将我的代码更改为:
ResourceManager manager = ResourceManager.getInstance(this, this.cordova.getContext());
和
ResourceManager manager = ResourceManager.getInstance(this, this.cordova.getActivity());
也尝试过:
ResourceManager manager = ResourceManager.getInstance(this, cordova.getActivity().getApplicationContext());
但它仍会抛出相同的错误消息
答案 0 :(得分:0)
修复:问题与获取applicationContext无关,ResourceManager中存在问题