I don't understand how this piece of code can function correctly:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
launch(Dispatchers.Main) {
log("A")
}
log("B")
}
This should output B first, followed by A.
Does this work give that the main thread is already under coroutine control? Maybe code is magically injected into the main thread by the coroutines API.