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

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.

主站蜘蛛池模板: 麻城市| 恩施市| 凤台县| 怀化市| 德江县| 四会市| 潼南县| 泗水县| 栾城县| 昭苏县| 霞浦县| 运城市| 北京市| 澄江县| 封丘县| 奎屯市| 洛阳市| 长海县| 乌苏市| 辽阳市| 海兴县| 聂拉木县| 金湖县| 合作市| 莒南县| 广安市| 台安县| 阿城市| 玉林市| 微博| 长泰县| 东明县| 五指山市| 同心县| 房产| 石首市| 竹北市| 阿巴嘎旗| 莆田市| 布拖县| 东乌珠穆沁旗|