解决:Only the original thread that created a view hierarchy can touch its views
2014-01-01 22:52
645 查看
Only the original thread that created a view hierarchy can touch its views 从字面就知道是由于没在主线程中更新UI所导致的,解决方案也很简单,只要加handler就好了。
比如我自己的应用环境:
private Handler handler =
new Handler() {
public
void handleMessage(Message msg) {
body.setText("");
// 关闭ProgressDialog
progressDialog.dismiss();
}
};
调用handler:
handler.sendEmptyMessage(0);
只是很简单的一个小问题,之前没留意。。。
比如我自己的应用环境:
private Handler handler =
new Handler() {
public
void handleMessage(Message msg) {
body.setText("");
// 关闭ProgressDialog
progressDialog.dismiss();
}
};
调用handler:
handler.sendEmptyMessage(0);
只是很简单的一个小问题,之前没留意。。。
相关文章推荐
- Only the original thread that created a view hierarchy can touch its views的解决记录
- 开发中错误记录:解决:Only the original thread that created a view hierarchy can touch its views.
- 解决Only the original thread that created a view hierarchy can touch its views
- "Only the original thread that created a view hierarchy can touch its views."解决
- "Only the original thread that created a view hierarchy can touch its views.” 解决方法
- Android 解决Only the original thread that created a view hierarchy can touch its views异常
- android开发中出现Only the original thread that created a view hierarchy can touch its views.错误的解决方法
- 浅析Android中的消息机制-解决:Only the original thread that created a view hierarchy can touch its views.
- Work 工作子线程更新UI控件--解决Only the original thread that created a view hierarchy can touch its views
- 开发错误记录1:解决:Only the original thread that created a view hierarchy can touch its views.
- 已解决:Only the original thread that created a view hierarchy can touch its views.
- 浅析Android中的消息机制-解决:Only the original thread that created a view hierarchy can touch its views. .
- 浅析Android中的消息机制-解决:Only the original thread that created a view hierarchy can touch its views.
- 浅析Android中的消息机制-解决:Only the original thread that created a view hierarchy can touch its views.
- 浅析Android中的消息机制-解决:Only the original thread that created a view hierarchy can touch its views.
- 浅析Android中的消息机制-解决:Only the original thread that created a view hierarchy can touch its views.
- 解决Only the original thread that created a view hierarchy can touch its views
- Android进阶——Handler的应用之解决Only the original thread that created a view hierarchy can touch its views
- 完美解决Only the original thread that created a view hierarchy can touch its views
- Android初学习 - 解决 "Only the original thread that created a view hierarchy can touch its views"