标签: android kotlin-coroutines
我想调用API,如果返回错误,我想再次调用它,直到不返回onSuccess。
也在onSuccess块中,我想更新UI。我尝试将UI函数包装到withContext(Dispatchers.Main) {}中,但这不起作用。它引发错误Only the original thread that created a view hierarchy can touch its views.
withContext(Dispatchers.Main) {}
Only the original thread that created a view hierarchy can touch its views.