https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

jw

04/30/2018, 2:18 PM
you should use
runBlocking
👍🏼 1
d

dave08

05/01/2018, 2:23 AM
I was afraid of that being deprecated, because of this https://github.com/Kotlin/kotlinx.coroutines/issues/227, bit I guess since there's no ui to change runBlocking uses and I just noticed that the default context in runBlocking is EmptyCoroutineContext, it's not the same as UI in the case of that issue... Right?
j

jw

05/01/2018, 2:25 AM
IntentService does not run on the UI thread. You're supposed to block on the thread where it delivers the callbacks.
Alternatively, don't use IntentService and use a normal Service and normal coroutine async/launch work.
d

dave08

05/01/2018, 2:26 AM
Thanks for confirming! 👍🏼
5 Views