I have two LiveData
:
MutableLiveData<Int>
-User could choose number by taping at "+" and "-" buttton.LiveData> - it's my data from RoomData base by call method
getLessonsForThatDay(number:Int)
.
I have to update my method getLessonForThatDay(value) with that MutableLiveData value.
I've tried to use MediatorLiveData<> but i don't get it.
viewModel.dayOfWeek.observe(viewLifecycleOwner, androidx.lifecycle.Observer { dayOfWeekValue ->
d("$dayOfWeekValue")
viewModel.getLessonsForThatDay(dayOfWeekValue).observe(viewLifecycleOwner, androidx.lifecycle.Observer { lessons ->
adapter.updateData(lessons)
subjectsListTimetableRecyclerView.layoutManager = LinearLayoutManager(context)
subjectsListTimetableRecyclerView.adapter = adapter
})
})
- List item