addListener

fun addListener(lifecycleOwner: LifecycleOwner, listener: T)

Add a listener that will receive events when its LifecycleOwner is active.

The lifecycleOwner must not be in a destroyed state when calling this method.

Throws

When the listener is already registered.