Observing Mediatorlivedata Issue
I have the following LiveData variables in my ViewModel (simplified example): I'm trying to use MediatorLiveData to have one 'stream' of data connecting to my RecyclerView. I ther
Solution 1:
You can use postValue
instead of setValue
If you called this method multiple times before a main thread executed a posted task, only the last value would be dispatched.
Baca Juga
- How Can I Make Separate Code On Onchanged() While Observing With Livedata In Mvvm? [not Solved]
- How To Retrieve List Of Objects From Dao Via Livedata<> In View Model When There Is No Change To Trigger Onchange Method In View Model In Android
- Pass Data To Another Fragment By Swipe View With Tab Android Studio,not Button
Post a Comment for "Observing Mediatorlivedata Issue"