0

so heres the issues,

i'm using fragmenttabhost with four tab, Tab A(FragA), Tab B(FragB), Tab C, Tab D

when i using Tab B, and i do a fragment transaction to replace the fragment on Tab B(FragB) to another fragment(FragB_2), it is added to the back stack, so i can still navigate back by using the back button. but when at Tab B new fragment, i click on Tab A, Tab C, Tab D. then when i go back to Tab B, the tab will be displaying the new fragment(FragB_2), and when i press on the back button.. no fragment is display.

i had try to remove the backstack whenever i do tab change. etc

if (fm.getBackStackEntryCount() > 0) 
{
    Log.i("MainActivity", "popping backstack");

        fm.popBackStack();
}

this code remove the Fragment B_2 from the TabB, but whenever i go back to Tab B again, Fragment B is gone.

how to i go around it?

4

0 に答える 0