MutableLiveData

public class MutableLiveData
extends LiveData<T>

java.lang.Object
   ↳ androidx.lifecycle.LiveData<T>
     ↳ androidx.lifecycle.MutableLiveData<T>


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

Summary

Public constructors

MutableLiveData(T value)

Creates a MutableLiveData initialized with the given value.

MutableLiveData()

Creates a MutableLiveData with no value assigned to it.

Public methods

void postValue(T value)

Posts a task to a main thread to set the given value.

void setValue(T value)

Sets the value.

Inherited methods