CoroutineScope : Android
- Lifescycle scope
- Global Scope
- ViewmodelScope (Custom Scope )
Lifescycle scope
Use lifecycle-aware scopes like
lifecycleScope
or viewLifecycleOwner.lifecycleScope
provided by Jetpack's Lifecycle library to automatically manage coroutine lifecycles.Global Scope
Global scope alive till application running
Viewmodel Scope
Viewmodel scope will alive till activity or fragment
can able to use multiple fragment or activity.