I am developing an Android app with fragments that has many possible flows. With simple Activity-based flow, it can flow like this:
A -> B -> E
A -> C -> E
A -> D -> E
With fragments, I would like to be able to do this same thing with a screen split into thirds. The question that I am asking is: in my layout XML file, how do I represent a space that may be filled with one of three different fragments?
Take a look at
FragmentTransaction.add()function:In other words, just create any empty
GroupViewin your xml layout and pass id of this group into this function when adding the fragment. Then remove it when you don’t want it anymore.