ImmutableLiveData

class ImmutableLiveData<T>(value: T) : LiveData<T>

A LiveData class which has the value set during construction.

Clients may prefer to use this class rather than androidx.lifecycle.MutableLiveData:

  1. If this class is more convenient to use. With this class, in a single call, a LiveData instance with a value already set can be created.

  2. If they would like to guarantee with typing that the LiveData will not change.

Parameters

value

The value to set.

Constructors

Link copied to clipboard
fun <T> ImmutableLiveData(value: T)

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)