I have an external event that changes several fragments state, As I am using Android architecture components I've created several ModelViews for every fragment.
What is the right way to send messages between ModelViews
I am assuming you are using viewModel to preserve state across activity and fragment recreations. You do realize that a viewModel is essentially your model class, right? So why would you want to send messages between viewModels?
If you have an external event that changes a fragment's state, you should propagate it to your activities who will then send those message to your fragments where you can update your view model's state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With