Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MutableLivedata observer triggering

I have a question about MutableLiveData in Viewmodel. Does just setValue function of MutableLiveData trigger observation? If we change content of MutableLiveData witout setValue, may it be triggered?

like image 271
ahmetvefa53 Avatar asked Dec 04 '25 00:12

ahmetvefa53


1 Answers

I doubt it. Only the mothods below dispatch events to observables:

liveData.postValue("a");
liveData.setValue("b");

https://developer.android.com/reference/android/arch/lifecycle/MutableLiveData

like image 159
Jeremi Avatar answered Dec 05 '25 16:12

Jeremi