当在非UI线程中更新UI(程序界面)时会出现如下图所示的异常:
Only the original thread that created a view hierarchy can touch its views.
那如何才能在非UI线程中更细UI呢?
方法有很多种,在这里主要介绍两种:
第一种:在需要更新UI的代码行后加Looper.prepare();与Looper.loop();两句话即可。如:...
分类:
移动开发 时间:
2014-08-27 20:34:08
阅读次数:
352
Agri-NetTime Limit: 1000msMemory Limit: 10000KBThis problem will be judged onPKU. Original ID:125864-bit integer IO format:%lld Java class name:MainFa...
分类:
Web程序 时间:
2014-08-27 20:13:28
阅读次数:
348
Road ConstructionTime Limit: 2000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:335264-bit integer IO format:%lld Java class na...
分类:
其他好文 时间:
2014-08-27 16:23:47
阅读次数:
202
SPFTime Limit: 1000msMemory Limit: 10000KBThis problem will be judged onPKU. Original ID:152364-bit integer IO format:%lld Java class name:MainConside...
分类:
其他好文 时间:
2014-08-27 16:10:17
阅读次数:
171
Little Tiger vs. Deep MonkeyTime Limit: 1000msMemory Limit: 65535KBThis problem will be judged onHDU. Original ID:481564-bit integer IO format:%I64d J...
分类:
其他好文 时间:
2014-08-27 10:44:38
阅读次数:
307
StringTime Limit: 1000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:482164-bit integer IO format:%I64d Java class name:MainGiv...
分类:
其他好文 时间:
2014-08-26 22:48:36
阅读次数:
214
ElectricityTime Limit: 5000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:211764-bit integer IO format:%lld Java class name:Mai...
分类:
其他好文 时间:
2014-08-26 13:23:46
阅读次数:
219
NetworkTime Limit: 1000msMemory Limit: 10000KBThis problem will be judged onPKU. Original ID:114464-bit integer IO format:%lld Java class name:MainA T...
分类:
Web程序 时间:
2014-08-25 22:28:34
阅读次数:
340
Equivalent SetsTime Limit: 4000msMemory Limit: 104857KBThis problem will be judged onHDU. Original ID:383664-bit integer IO format:%I64d Java class na...
分类:
其他好文 时间:
2014-08-25 21:08:34
阅读次数:
243
Network of SchoolsTime Limit: 1000msMemory Limit: 10000KBThis problem will be judged onPKU. Original ID:123664-bit integer IO format:%lld Java class n...
分类:
Web程序 时间:
2014-08-25 19:08:04
阅读次数:
201