0

我正在尝试在我的插件中获取应用程序上下文,但它会引发此错误:

无法在未调用 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());

但它仍然抛出相同的错误信息

4

1 回答 1

0

已修复:该问题与获取 applicationContext 无关,ResourceManager 中存在问题

于 2012-09-25T21:21:37.923 回答