Android Handler Message 通信机制

2014-11-24 14:14:36 · 作者: · 浏览: 2



上面的例子会报“Only the original thread that created a view hierarchy can touch its views.


正确的写法应该是在子线程中组装数据,然后通过handler发送消息给UI线程,最后在UI线程中更新UI: