Kotlin Coroutines the right way in Android

前端 未结 9 1118
醉酒成梦
醉酒成梦 2020-12-02 06:51

I\'m trying to update a list inside the adapter using async, I can see there is too much boilerplate.

Is it the right way to use Kotlin Coroutines?

can this

9条回答
  •  醉话见心
    2020-12-02 07:08

    All the above answers are right, but I was having a hard time finding the right import for the UI from kotlinx.coroutines, it was conflicting with UI from Anko. Its

    import kotlinx.coroutines.experimental.android.UI
    

提交回复
热议问题