You aren't properly replacing the fragments.
First of all the documentation for the FragmentTransaction.replace()
method is pretty clear and it states that the id
supplied to it should be the id
of the the container whose fragment(s) are to be replaced and not the id
of the Fragment
to be replaced like you do.
Second, you're mixing static fragments(declared in the xml layout) with dynamic ones(which are added at runtime), which you shouldn't be doing. If you're going to replace that Fragment
you'll need to declare that Fragment
in code and not in the xml layout(see this response from one of the Android engineers regarding this matter).
So, instead of the frameOne
Fragment
insert a wrapper layout(like a FrameLayout
for example) with an id
. In the onCreate
method you'll add your initial Fragment
(BowlersListFragment
) and then, based on a selection in that Fragment
, you'll replace it by giving to the FragmentTransaction.replace()
method the id
of the wrapper layout and the new Fragment
instance.