Lifecycle-aware components such as fragments, provide first-class coroutine support for logical scopes in your app along with an interoperability layer with LiveData
. A LifecycleScope
is defined for each Lifecycle
object. Any coroutine launched in this scope is canceled when the Lifecycle
owner is destroyed.
LifecycleScope
is a CoroutineScope.
A rule is a way to run code before and after the execution of a test in JUnit.