I am reading basics of coroutines from docs, I have a doubt like :
Copy code
launch {
doingNetworkCall() // this is suspend function
}
// doing some work on main thread here like loading
so assume doingNetworkCall() is taking some time, till that time that function get suspended OR it just works in background thread and on completion it returns like callback and do other work
and if this work is getting suspended, then when it is getting resumed to achieve desired output
c
Casey Brooks
01/27/2021, 3:01 PM
You will want to run everything in the same coroutine (one
launch { }
block) and switch contexts as necessary to ensure things get run on the proper threads.