• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Layout Inflater or different Fragments

wakille

Lurker
Hey,
I am programming a TabLayout and not sure what the best way is to change the content, when changing the tab. Should I use Fragments or just inflate a new Layout, everytime I change the tab. Could you maybe give some pro and con for both methods ?

Thanks!
 
Based on this project, is there a way to pass data between fragment using viewmodel and .observe()?
Exemple one fragment contains a buton which increment a value in viewmodel and the observer of the 2nd and 3rd fragment update their textview with this value?
I am stuck on the fact that the .observe do not react to the value change....
 
Back
Top Bottom