当前位置: 代码迷 >> Android >> android "Only the original thread that created a view hierarchy can touch its v"
  详细解决方案

android "Only the original thread that created a view hierarchy can touch its v"

热度:151   发布时间:2016-05-01 15:35:29.0
android "Only the original thread that created a view hierarchy can touch its v"
android在新的线程中操作view时出现的异常如题, 可以用如下操作解决。
final Handler mHandler = new Handler() {			public void handleMessage(Message msg) {				super.handleMessage(msg);				//update your view function			}		};           new Thread( new Runnable() {            public void run() {              	//download data function            	mHandler.sendMessage(mHandler.obtainMessage());             } 		}).start();


参考:
http://hi.baidu.com/googledev/blog/item/b076a850e11d706684352456.html
  相关解决方案