Skip to content
Advertisement

Tag: android-menu

How can I switch between Fragments without destroying and re-creating them? (in a static-like way)

My app uses a BottomNavigationBar to switch between Fragments, and it does it this way: I want those Fragments to be static, so their content and views do not dissapear when I switch between them. I have tried to create them inside MainActivity’s onCreate() method, but it only helps with retaining text inside EditText widgets, the rest of the views

Advertisement