withAttachedView

Creates a new LifecycleOwner that limits the state of this LifecycleOwner to Lifecycle.State.CREATED if the view is detached.

The new lifecycle will destroy itself when this LifecycleOwner does. The destruction is permanent.