最近在学习Android, 在创建线程的时候操作视图出现了问题:

代码如下
  1. 09-20 08:42:44.234: ERROR/AndroidRuntime(399): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

找了好久资料才知道,线程里面操作视图要在Handler里面,而不能在主线程里面

下面是原来的代码:
代码如下
  1.  

  2. ......