I'm new in development and I'm aware that stack isn't for 'full code requests'. But I'm stuck and can't find the solution.
I'm using Room
database which has two columns - firstName
and lastName
. I'm loading the database with passed firstName
parameter:
@Query("SELECT * FROM passenger WHERE firstName LIKE :firstName")
List<Passenger>getAllByName (String firstName);
It works as supposed.
But.. When I want to update Passenger
, I need to populate data again, again, and again. There comes LiveData
and observer
.
But.. setValue
in LiveData
is private and I cannot send any parameters for Query line. There comes MutableLiveData, but how can I implement that?