SubLifecycleOwner
class SubLifecycleOwner(parentLifecycleOwner: LifecycleOwner) : LifecycleOwner
Content copied to clipboard
An owner of a sub-lifecycle of the given parentLifecycleOwner. The state of the sub-lifecycle is always in a state that is at most the parentLifecycleOwner's state. It can be a lower state either due to being limited with stateLimit or if the sub-lifecycle is destroyed.
The stateLimit allows the sub-lifecycle state, for instance, to remain in the State.CREATED state when parentLifecycleOwner's state is State.STARTED or State.RESUMED.
The sub-lifecycle owner may be destroyed sooner than the destruction of parentLifecycleOwner.