dave08
01/13/2020, 10:47 AMGlobalScope
for coroutines that need to be tied to the Application
? There doesn't seem to be a lifecycleScope
for it... or is it better to create a CoroutineScope
and cancel it somewhere in the Application
?Ianmedeiros
01/13/2020, 2:04 PMMichael Friend
01/13/2020, 3:51 PMGlobalScope
. See https://kotlinlang.org/docs/reference/coroutines/exception-handling.html#coroutineexceptionhandler for how to handle exceptions yourself when using GlobalScope
. Also notice that viewModelScope
and lifeCycleScope
implementations both use a SupervisorJob
to handle exceptions in children, which you wouldn’t get in GlobalScope
dave08
01/13/2020, 4:27 PM