(android)Can't Create handler inside thread that has not called Looper.prepare()
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(android)Can't Create handler inside thread that has not called Looper.prepare()相关的知识,希望对你有一定的参考价值。
接android游戏sdk中,经常会遇到Looper报错,此时需要在主线程中调用sdk函数。
将sdk的函数放到UI线程中执行。
如:
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
本文出自 “Quick” 博客,请务必保留此出处http://quick007.blog.51cto.com/7454007/1774189
以上是关于(android)Can't Create handler inside thread that has not called Looper.prepare()的主要内容,如果未能解决你的问题,请参考以下文章
Android handler 报错处理Can't create handler inside thread that has not called Looper.prepare()(示例代码
Can't create handler inside thread that has not called Looper.prepare()
Can't create handler inside thread that has not called Looper.prepare()
Minecraft出错: Can't create cache file!
解决使用Handler时Can't create handler inside thread that has not called Looper.prepare()
Can‘t create handler inside thread that has not called Looper.prepare()