官术网_书友最值得收藏!

CalledFromWrongThreadException

Android will throw a CalledFromWrongThreadException whenever a thread that didn't create a view hierarchy tries to update its views. In practical terms, this exception will happen whenever a thread other than the UI thread updates a view. This is because the UI thread is the only one that can create view hierarchies, so it will always be the one that can update them.

It's important to guarantee that code that will update the UI is running in the UI thread. In our example, we will update a label on the UI thread after calling a service on a background thread.

主站蜘蛛池模板: 商丘市| 大方县| 宜城市| 临夏县| 海丰县| 辽宁省| 曲阳县| 大新县| 隆化县| 丁青县| 深圳市| 五寨县| 阳泉市| 吉水县| 布尔津县| 铁岭县| 琼中| 广汉市| 盈江县| 彭水| 荣成市| 教育| 庆安县| 全南县| 湖南省| 应用必备| 定安县| 仲巴县| 亚东县| 阿合奇县| 北票市| 翁牛特旗| 鄢陵县| 丰台区| 正阳县| 巢湖市| 阿拉善左旗| 堆龙德庆县| 手机| 甘肃省| 婺源县|