Coroutines `Dispatchers.Main` being run in an Andr...
# android
d
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
@dave08 Android Services run on the main thread. IntentServices, which have their own HandlerThread are deprecated since API 26.
👍 3
d
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
@dave08
runBlocking
is your only solution if you use an
IntentService