MutableLiveData

open class MutableLiveData<T : Any!> : LiveData<T>
kotlin.Any
   ↳ androidx.lifecycle.LiveData<T>
   ↳ androidx.lifecycle.MutableLiveData

LiveData which publicly exposes setValue(T) and postValue(T) method.

Summary

Public constructors

<init>(value: T)

Creates a MutableLiveData initialized with the given value.

Creates a MutableLiveData with no value assigned to it.

Public methods

open Unit
postValue(value: T)

open Unit
setValue(value: T)

Inherited functions

Public constructors

<init>

MutableLiveData(value: T)

Creates a MutableLiveData initialized with the given value.

Parameters
value T: initial value

<init>

MutableLiveData()

Creates a MutableLiveData with no value assigned to it.

Public methods

postValue

open fun postValue(value: T): Unit

setValue

open fun setValue(value: T): Unit