Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Observe the MediatorLiveData given by ViewModel, and update RecyclerViewAdapter accordingly.
mainViewModel = ViewModelProvider(activity!!).get(MainViewModel::class.java)
// New observer
mainViewModel.getAllData()?.observe(viewLifecycleOwner,
Observer { subjectsAndRemindersPair ->
view.sro_subject_list.adapter = SubjectRecyclerViewAdapter(
subjectsAndRemindersPair.first,
subjectsAndRemindersPair.second,
listener)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.