diff --git a/app/src/main/java/keijumt/devandroid/viewmodel/AsyncViewModel.kt b/app/src/main/java/keijumt/devandroid/viewmodel/AsyncViewModel.kt index 6edc5e9..264b83a 100644 --- a/app/src/main/java/keijumt/devandroid/viewmodel/AsyncViewModel.kt +++ b/app/src/main/java/keijumt/devandroid/viewmodel/AsyncViewModel.kt @@ -7,6 +7,7 @@ import io.reactivex.rxkotlin.subscribeBy import io.reactivex.schedulers.Schedulers import keijumt.devandroid.common.Task +import kotlinx.coroutines.experimental.android.UI import kotlinx.coroutines.experimental.async import kotlinx.coroutines.experimental.launch import javax.inject.Inject @@ -23,7 +24,7 @@ } fun coroutine() { - launch { + launch(UI) { val result = calc(3).await() * calc(5).await() println(result) }