-2

My fragmentTabhost include 4 fragments(FragmentA,FragmentB,FragmentC,FragmentD) in the FragmentTabhost .

In FragmentA, I use the code:

getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, Fragment_a1).commitAllowingStateLoss();

to jump to the Fragment_a1(not in the tabhost).

But I found a bug when switching the fragment.Such like this order: FragmentA->Fragment_a1->FragmentB->FragmentA .

When switch to the FragmentA after this order,the screen shows the Fragment_a1 (It should show the FragmentA). Printing the logcat I found the Fragment_a1 can`t be destoryed when switch to FragmentB.

Please give me a hand .Thanks!

Manigandan Arjunan
  • 2,260
  • 1
  • 25
  • 42
Kim
  • 1
  • 2

1 Answers1

0

Now I have another method to solve this problem after reading the answer @ How to make particular tab in FragmentTabHost has multiple fragment navigations like tabgroupactivity

Community
  • 1
  • 1
Kim
  • 1
  • 2