Only the original thread that created a view hierarchy can touch its views<已解决>_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > 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<已解决>

 2010/9/19 23:33:02  bywyu  http://bywyu.javaeye.com  我要评论(0)
  • 摘要:子线程不可以更新UI主线程newThread(){publicvoidrun(){mHandler.sendmessage(newMessage());}finalHandlermHandler=newHandler(){publicvoidhandleMessage(Messagemsg){super.handleMessage(msg);//更新具体的线程}};
  • 标签:Only original thread created view hierarchy can touch views<已解决>

线程不可以 更新UI主线程

 new Thread() {
	    public void run() {
	        mHandler.sendmessage(new Message());
	    }
 final Handler mHandler = new Handler() {  
	               public void handleMessage(Message msg) {  
	                   super.handleMessage(msg);
	                  //更新具体的线程
? ? ? ? ? ? ? ? ? ? ? ? ? ? }  
	           };  
发表评论
用户名: 匿名