Typical use for AsyncTask: I want to run a task in another thread and after that task is done, I want to perform some operation in my UI thread, namely hiding a progress bar
This does not use coroutines, but it's a quick solution to have a task run in background and do something on UI after that.
I'm not sure about the pros and cons of this approach compared to the others, but it works and is super easy to understand:
Thread {
// do the async Stuff
runOnUIThread {
// do the UI stuff
}
// maybe do some more stuff
}.start()
With this solution, you can easily pass values and objects between the two entities. You can also nest this indefinitely.