You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API 通信のメソッドで sleep を入れる(通信が遅い状況をイメージ)と、その間に他のタブを押しても反応しない
(『応答していません』と出てアプリが落ちる)
viewModel が死んでも、通信は終わってない
viewModel のライフサイクルで使えそうなのがある?
onCleared()
This method will be called when this ViewModel is no longer used and will be destroyed.
It is useful when ViewModel observes some data and you need to clear this subscription
to prevent a leak of this ViewModel.
ちょっと調べた感じ、以下のブロックは Main Thread で実行されてまってそう。。。
ログに出してみた結果、main って出てるけど本当?
(main だと通信できない気がしたり。。。)
この辺を参考にして、ベストプラクティスに従っていく。
https://developer.android.com/kotlin/coroutines/coroutines-adv?hl=ja#perf
The text was updated successfully, but these errors were encountered: