情况一
lifecycleScope.launch(Dispatchers.IO){
delay(5000)
click.text ="点点我"
}
情况二
lifecycleScope.launch(Dispatchers.IO){
click.text ="点点我"
}
情况一会crash(android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.),情况二不会,这是为什么?
网友评论