如何递归启动协同程序?

时间:2019-06-13 09:59:53

标签: android kotlin-coroutines

我想调用API,如果返回错误,我想再次调用它,直到不返回onSuccess。

也在onSuccess块中,我想更新UI。我尝试将UI函数包装到withContext(Dispatchers.Main) {}中,但这不起作用。它引发错误Only the original thread that created a view hierarchy can touch its views.

0 个答案:

没有答案