1

I'm working with an activity and some fragments. I want to pass data from Fragment A to fragment B after on click element and at the same time navigate from Fragment A to Fragment B.

I read about

ViewModel

to share data between the fragments, but I can not find any information about how to handle the navigation and the use of the ViewModel class in the correct way.

Can anyone provide some example or link aout how to handle this in the correct way to NOT make some "dirty" code or something like that will affect the performance of the app?

I would be very grateful if someones can help with that, thanks.

Nega developer
  • 259
  • 3
  • 8
  • 19

0 Answers0