大体上想实现一个思路: 对一个view 的内容进行不停地变化, 通过按钮停止这种变化,以达到随机选择的目的. 开发过程中 使用textview 模拟, 建立线程 mythread = new Thread() { @Override public void run() { while(isrun) { 改变textview } } } 结果遭遇报错 Only the original thread that created a view hierarchy can touch its view
这是一条规律,很多coder知道,但原因是什么呢? 如下: When a process is created for your application, its main thread is dedicated to running a message queue that takes care of managing the top-level application objects (activities, broadcast receivers, etc) and any windows