Hey guys. In the following design, I have a BottomAppBar with 4 icons.
Each icon, cause the screen to show a different Fragment, totalling 4 different Fragments (some screens have sub fragments in them).
Currently, I created a variable "currentlySelectedFragment".
Whenever an Icon is selected, that variable is changed causing the FragmentManager to replace the previously selected Fragment (thus killing it too)
Do you think, that I should keep all of the 4 Fragments alive? as i perform replace, the next time I open that Fragment I need to do loading again.
I wonder what is the best practice regarding Fragments here.
Because on one side, I need to load the UI again everytime, on the other side I don't want to use too much memory.