android-components / mozilla.components.support.base.observer / Observable / register

register

abstract fun register(observer: T): Unit (source)

Registers an observer to get notified about changes.

Parameters

observer - the observer to register.

abstract fun register(observer: T, owner: LifecycleOwner, autoPause: Boolean = false): Unit (source)

Registers an observer to get notified about changes.

The observer will automatically unsubscribe if the lifecycle of the provided LifecycleOwner becomes DESTROYED.

Parameters

observer - the observer to register.

owner - the lifecycle owner the provided observer is bound to.

autoPause - whether or not the observer should automatically be paused/resumed with the bound lifecycle.

abstract fun register(observer: T, view: View): Unit (source)

Registers an observer to get notified about changes.

The observer will automatically unsubscribe if the provided view gets detached.

Parameters

observer - the observer to register.

view - the view the provided observer is bound to.