我正在尝试在我的插件中获取应用程序上下文,但它会引发此错误:
无法在未调用 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());
但它仍然抛出相同的错误信息