I have the following LiveData variables in my ViewModel (simplified example):
LiveData
ViewModel
val currentUser : LiveData<UserObject> val allSites : LiveData<ArrayList<SiteObject>> val filterSitesForUser : LiveData<Boolean> val orderSitesByField : LiveData<String> val orderSitesDirection : LiveData<Query.Direction> val searchFilterSitesText : LiveData<String>
You can use postValue instead of setValue
postValue
setValue
If you called this method multiple times before a main thread executed a posted task, only the last value would be dispatched.
2.1m questions
2.1m answers
60 comments
57.0k users