elizarov
06/20/2017, 8:56 PMlaunch(UI) { ... }
and then you either use some suspending function that is already asynchronous or, if you have a blocking function, you convert it to suspending one using run (not async, which returns a future):
launch(UI) {
val json = fetchFromNetwork()
// update UI
}
suspend fun fetchFromNetwork() = run(CommonPool) { ... }