Home | History | Annotate | Download | only in lifecycle

Lines Matching defs:LiveData

32  * LiveData is a data holder class that can be observed within a given lifecycle.
43 * activities and fragments where they can safely observe LiveData and not worry about leaks:
47 * In addition, LiveData has {@link LiveData#onActive()} and {@link LiveData#onInactive()} methods
49 * This allows LiveData to release any heavy resources when it does not have any Observers that
59 public abstract class LiveData<T> {
138 * owner. The events are dispatched on the main thread. If LiveData already has data
150 * LiveData keeps a strong reference to the observer and the owner as long as the
151 * given LifecycleOwner is not destroyed. When it is destroyed, LiveData removes references to
154 * If the given owner is already in {@link Lifecycle.State#DESTROYED} state, LiveData
158 * If the observer is already in the list with another owner, LiveData throws an
185 * {@link LiveData#observe(LifecycleOwner, Observer)} with a LifecycleOwner, which
188 * observing this LiveData.
189 * While LiveData has one of such observers, it will be considered
192 * If the observer was already added with an owner to this LiveData, LiveData throws an
202 if (existing != null && existing instanceof LiveData.LifecycleBoundObserver) {
248 * liveData.postValue("a");
249 * liveData.setValue("b");
311 * This callback can be used to know that this LiveData is being used thus should be kept
332 * Returns true if this LiveData has observers.
334 * @return true if this LiveData has observers
342 * Returns true if this LiveData has active observers.
344 * @return true if this LiveData has active observers
409 boolean wasInactive = LiveData.this.mActiveCount == 0;
410 LiveData.this.mActiveCount += mActive ? 1 : -1;
414 if (LiveData.this.mActiveCount == 0 && !mActive) {