Use ktx lifecycleScope
I would recommend to use the coroutines lifecycleScope provided by the androidx libraries to make the coroutines approach even cleaner:
https://developer.android.com/topic/libraries/architecture/coroutines#lifecyclescope
Other than that it's a great article!
I would recommend to use the coroutines lifecycleScope provided by the androidx libraries to make the coroutines approach even cleaner:
https://developer.android.com/topic/libraries/architecture/coroutines#lifecyclescope
Other than that it's a great article!
Hi! Can you give us an example of a SplashScreen using these coroutines?
Thanks!
It would be the same as the Coroutines Activity example, but instead of defining your own CoroutineScope, you would use this:
activity.lifecycleScope.launch {
// scope bound to Activity Lifecycle
}