Wednesday, November 20, 2024

CoroutineScope : Android

    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.




Check out this may be help you

Related Posts Plugin for WordPress, Blogger...