observe |
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. fun <T> LifecycleOwner.observe(liveData: LiveData<T>, observer: (T) -> Unit): Unit fun <T> LifecycleOwner.observe(liveData: MutableLiveData<T>, observer: (T) -> Unit): Unit |