I using MVVM on my Android application, on ViewModel I have many observers (from data binding) like ObservableBoolean
, ObservableField
, I read that I can use LiveData/MutableLiveData
instead this observers... What's the difference? I can replace all my data binding observers by LiveData/MutableLiveData
?
eg:
replace:
val loading: ObservableBoolean = ObservableBoolean()
By:
val loading: MutableLiveData<Boolean> = MutableLiveData()