Difference between LiveData, MutableLiveData

Haitham Haitham picture Haitham Haitham · Oct 12, 2018 · Viewed 11.7k times · Source

I know that the MutableLiveData extends LiveData, but what is the difference between them (in usage). What are appropriate use cases, means when to use the correct one from the two?

Answer

theanilpaudel picture theanilpaudel · Oct 12, 2018

LiveData is immutable while MutableLiveData is mutable. MutableLiveData extends LiveData and provides methods like setValue() and postValue().