vault backup: 2025-07-22 22:14:08
Affected files: Too many files to list
This commit is contained in:
8
21.01. OS/21.04. Android/UI.md
Normal file
8
21.01. OS/21.04. Android/UI.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## 在thread更新UI
|
||||
Android framework只能在main thread裡更新UI,若需要在其他的thread更新UI的話,需要呼叫activity的`runOnUiThread()`。
|
||||
例:
|
||||
```kotlin
|
||||
activity?.runOnUiThread {
|
||||
activity?.findViewById<TextView>(R.id.textView)?.text = "You say: " + call.parameters["something"]
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user