EmptyLiveData

class EmptyLiveData<T> : LiveData<T?>

An empty LiveData implementation for situations where we need a LiveData instance which will always have a null value.

When using this, observers will receive a callback for the null value of this instance. Because of this, EmptyLiveData can only be used for nullable types T. For non-nullable types T where no callback should be emitted, UnsetLiveData can be used instead.

Constructors

Link copied to clipboard
fun EmptyLiveData()

Inherited properties

Link copied to clipboard
val mActiveCount: Int
Link copied to clipboard
val mDataLock: Any
Link copied to clipboard
val mPendingData: Any

Inherited functions

Link copied to clipboard
open fun changeActiveCounter(p0: Int)
Link copied to clipboard
open fun dispatchingValue(@Nullable p0: LiveData.ObserverWrapper<T?>?)
Link copied to clipboard
open fun getValue(): T?
Link copied to clipboard
open fun getVersion(): Int
Link copied to clipboard
open fun hasActiveObservers(): Boolean
Link copied to clipboard
open fun hasObservers(): Boolean
Link copied to clipboard
open fun observe(@NonNull p0: LifecycleOwner, @NonNull p1: Observer<in T?>)
Link copied to clipboard
open fun observeForever(@NonNull p0: Observer<in T?>)
Link copied to clipboard
open fun onActive()
Link copied to clipboard
open fun onInactive()
Link copied to clipboard
open fun postValue(p0: T?)
Link copied to clipboard
open fun removeObserver(@NonNull p0: Observer<in T?>)
Link copied to clipboard
open fun removeObservers(@NonNull p0: LifecycleOwner)
Link copied to clipboard
open fun setValue(p0: T?)