Questions tagged [mutablelivedata]

LiveData which publicly exposes setValue(T) and postValue(T) method.

320 questions
-1
votes
1 answer

LiveData from room and MutableLiveData to display error message

Source code can be found at : https://github.com/AliRezaeiii/TVMaze I have following repository class : class ShowRepository( private val showDao: ShowDao, private val api: TVMazeService ) { /** * A list of shows that can be shown…
Ali
  • 9,800
  • 19
  • 72
  • 152
-1
votes
1 answer

LiveData observer not getting triggered in Kotlin

I am using LiveData with Kotlin in my project. I have been facing an intermittent issue wherein the Observer attached to a MutableLiveData object is sometimes not getting triggered. The Observer is attached in the activity onCreate(), (with the…
-2
votes
1 answer

what are the correct methods to Observe MutableLiveData > ? Android

I am working on a RecyclerView that retrieves some of the data from an Object, every time a new object is created that object will be added into SQLiteDatabase and then to my ViewModel MutableLiveData. so my question is how can i set a…
two
  • 15
  • 2
-2
votes
1 answer

Mutable Live Data vs Live Data

Ok I get the concept, but I’m a bit confused, the mutableLiveData gives you access to the set and Post method, which you use to add Values to your live data, it then calls the onChanged method of the observer, why don’t we just use LiveData instead,…
-2
votes
1 answer

When using data binding In Xml MutableLiveData not suggested by Android Studio

When we use MutableLiveData in ViewModel when we use it in XML, Android Studio does not offer it to us? public class LoginViewModel extend ViewModel { public MutableLiveData userEntity; public UserEntity…
Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98
1 2 3
21
22