android开发中出现Only the original thread that created a view hierarchy can touch its views.错误的解决方法

来源:互联网 发布:php json对象转数组 编辑:程序博客网 时间:2024/06/05 16:43

出现 Only the original thread that created a view hierarchy can touch its views.这个错误是因为android中不允许子线程更新UI,

可以通过handler 的handlerMessage进行处理

子线程向主线程(UI线程)的用于更新Ui的handler发送msg,通过主线程的handler

的handlerMessage进行ui的更新。

稍后放出具体代码。。。

原创粉丝点击