2

I have an activity with launch mode SingleTop. This activity has a viewpager in it. I recreate the pager adapter on every onNewIntent call. It works fine but when i debug it i see that FragmentManager has the old fragments too. And of course it consumes more memory. How can i get rid of these fragments?

Thanks in advance.

syloc
  • 4,569
  • 5
  • 34
  • 49
  • Is the answer you're looking for here? http://stackoverflow.com/questions/5901298/how-to-get-a-fragment-to-remove-itself-i-e-its-equivalent-of-finish – jbenowitz Apr 25 '13 at 22:11
  • @jbenowitz; No it isn't. I tried getSupportFragmentManager().popBackStack(); and getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); neither of them worked. I don't think the fragments are kept in the history stack. – syloc Apr 25 '13 at 22:31

0 Answers0