https://kotlinlang.org logo
m

MisileLab

07/22/2021, 3:14 AM
how to make async tesk in kotlin?
h

HyunWoo Lee

07/22/2021, 3:23 AM
Do you mean AsyncTask class in Android? That was deprecated in Android 11(API 30). If you want to use alternative, just use coroutines, more concise and simple.
w

Werner Altewischer

07/23/2021, 8:49 AM
Use:
Copy code
runBlocking {

   // Call your suspending functions here

}
// All suspending functions are guaranteed to have finished here
👍 1
I assumed you meant ‘test’
3 Views