That is what I have in my app
- Activity with 2 fragment with ViewModels and Databinding.
- Room Database with Livedata to update UI continuously.
- Navigation Controller to navigate between fragments.
- Fragment #1 have RecyclerView (List of Custom Object).
- Fragment #2 is to Insert or Update operations (Transactions).
Everything works fine as expected, but one thing I can't figure out why it happens.
When I go to Fragment #2 to Insert or Update data to Room Database then back to Fragment #1 with (top or bottom) back button, fragment #1 doesn't reload and data doesn't change (update) until I reload data.
In other case when I Insert or Update data at the same fragment the list changes immediately.
Do I have to make insert and update operations at the same fragment?
Can't I do it at other fragments and when I go back to the list fragment I find that data is been updated?
Keep in mind that it was work like I hope but at some point i really don't know it doesn't any more !!