<Android: onClickListener fires a observer to upda...
# stackoverflow
u
Android: onClickListener fires a observer to update field on UI, again and again I have a question. This is my situation. I have a UI to update values on an Data Object (room data). Let's say that is a radio Button, but could be anything. I want that every time the user click on a field (radio button, text, checkbox) the database get updated, I don't want a "save" button. To achieve this, I have a bunch of onClicklistener() on each view element. These listeners call some method on the viewmodel instance, that updated the MutableLiveData of that class, firing, the observer...