mzgreen
12/06/2023, 11:24 AMval job = launch { someBackgroundWork() }
//... at some point later user clicks on the button
button.onClick {
runBlocking {
job.join()
}
// navigate to the next screen
}
so this blocks the main thread as expected but for some reason it never unblocks it. I’ve added the logs and I can see that someBackgroundWork finishes the work but the main thread is still blocked.
What am I missing? Maybe I shouldn’t use runBlocking at all and there is a nicer way to do this?Alex Prince
12/06/2023, 8:42 PMmzgreen
12/06/2023, 8:46 PMAlex Prince
12/06/2023, 8:47 PM