- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 102字
- 2021-08-05 10:46:47
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.
推薦閱讀
- ASP.NET Core:Cloud-ready,Enterprise Web Application Development
- Learning Single:page Web Application Development
- Machine Learning with R Cookbook(Second Edition)
- PHP+MySQL網站開發技術項目式教程(第2版)
- 基于差分進化的優化方法及應用
- Xamarin.Forms Projects
- 快速念咒:MySQL入門指南與進階實戰
- Mastering Apache Maven 3
- C#應用程序設計教程
- 運用后端技術處理業務邏輯(藍橋杯軟件大賽培訓教材-Java方向)
- Procedural Content Generation for C++ Game Development
- Unity&VR游戲美術設計實戰
- Vue.js應用測試
- 從零學Java設計模式
- Redmine Cookbook