https://kotlinlang.org logo
#android
Title
# android
d

dave08

12/23/2018, 5:09 PM
Coroutines
Dispatchers.Main
being run in an Android Service gives me the app's main ui thread, how do I run on the Service's thread? Passing the runBlocking's scope down? I really need it's handler...
l

louiscad

12/23/2018, 5:15 PM
@dave08 Android Services run on the main thread. IntentServices, which have their own HandlerThread are deprecated since API 26.
👍 3
d

dave08

12/23/2018, 5:18 PM
I have a SyncAdapter's Service and an IntentService running a certain hierarchy of tasks (I can't change this in the current version, I don't have enough time...), and I need to find a way to get my hands on the service's HandlerThread's handler... or just do runBlocking on it's dispatcher, what's the best way to do this @louiscad?
l

louiscad

12/23/2018, 5:45 PM
@dave08
runBlocking
is your only solution if you use an
IntentService
3 Views