Options for Anko's "doAsync" and "uiThread is ancient

49 views Asked by At

I'm still a beginner in Android, could you help me? I need to configure an app that previously used Anko's "doAsync" and "uiThread" but is now obsolete, what option do you recommend? I give an example of how I used it

dependence in build.gradle:

dependencies {
    implementation "org.jetbrains.anko:anko:$anko_version"
}

example of use in mainActivity.kt :

private fun getStores() {
 doAsync{
   val stores = StoreAplication.database.storeDao().getAllStores()
   uiThread{
     mAdapter.setStores(stores)
  }
}
0

There are 0 answers