`

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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics