commons/ui / com.vmadalin.commons.ui.livedata / SingleLiveData / observe

observe

@MainThread fun observe(owner: LifecycleOwner, observer: Observer<in T>): Unit

Adds the given observer to the observers list within the lifespan of the given owner. The events are dispatched on the main thread. If LiveData already has data set, it will be delivered to the observer.

Parameters

owner - The LifecycleOwner which controls the observer

observer - The observer that will receive the events

See Also

MutableLiveData.observe