以下代码无法编译,尽管文档说它应该像这样简单:
override fun onResume() {
super.onResume()
async {
Log.d("foo", "async")
}
}
错误是:
...kt: (31, 9): None of the following functions can be called with the arguments supplied:
@Deprecated public fun <T> async(context: CoroutineContext, start: Boolean, block: suspend CoroutineScope.() -> ???): Deferred<???> defined in kotlinx.coroutines.experimental
public fun <T> async(context: CoroutineContext, start: CoroutineStart = ..., block: suspend CoroutineScope.() -> ???): Deferred<???> defined in kotlinx.coroutines.experimental