12

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?

random.123
  • 65
  • 8
Haitham Haitham
  • 157
  • 1
  • 1
  • 6

1 Answers1

9

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

theanilpaudel
  • 3,348
  • 8
  • 39
  • 67