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

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.

主站蜘蛛池模板: 城市| 大港区| 巴林左旗| 桐梓县| 永德县| 崇信县| 宜宾县| 凤山市| 昭苏县| 西充县| 类乌齐县| 五指山市| 信宜市| 怀化市| 镇平县| 新竹市| 永嘉县| 阳高县| 石阡县| 芜湖县| 日喀则市| 舞阳县| 西乌| 普格县| 潜山县| 丰宁| 新郑市| 金山区| 榕江县| 鄂托克前旗| 平山县| 小金县| 鹿邑县| 若羌县| 清徐县| 宁波市| 惠东县| 峨眉山市| 黄陵县| 酉阳| 滕州市|