现在的位置: 首页 > 综合 > 正文

androiod开发中出现Can’t create handler inside thread that has not called Looper.prepare()的错误。

2018年04月04日 ⁄ 综合 ⁄ 共 167字 ⁄ 字号 评论关闭

出现原因:

        在线程里面添加了处理UI的代码,比如:findViewById(R.id.textview_title),以及Toast.makeText(MainActivity.this, 测试点不可到达",Toast.LENGTH_SHORT).show()等操作。

解决方案:将类似的这些UI的处理放在Handler里面。

抱歉!评论已关闭.