Presumably it would be unsafe to launch a coroutin...
# android
d
Presumably it would be unsafe to launch a coroutine using
lifecycleScope
in an activity's
onDestroy()
since the scope only spans until
onDestroy()
is called, right? What would be a suitable alternative to launch a coroutine to do some kind cleanup job that shouldn't be immediately canceled when the activity is destroyed?
MainScope
?
b
Injectable ApplicationScope should be the best option.
MainScope
is a short version for declaring scope with main dispatcher (which will work, but smells).
🙏 2