I got activity a. then I put b in backsatck and display it;
I want to call c such that a not called again however I want to pop B from BackStack such that return back from C I want it returns to A.
Here is the scenario:
A->B
C Called: A->C
C closed onback pressed: return back to A
However When I pop B from backstack (in order to replace it with C) fragment A onResume called and do not allow B to be displayed normally.
I also used:
fragmentManager.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE);`
However this does not fix the problem. Here is code for switchFragments:
fragmentManager.popBackStack(null,
FragmentManager.POP_BACK_STACK_INCLUSIVE);
if (fragment != null) {
FragmentTransaction transaction = fragmentManager
.beginTransaction();
transaction.replace(R.id.content_frame, fragment, tag);
// Only ArticlDetailFragment is added to the back stack.
if (!(fragment instanceof HomeFragment)
/* && isItNotification == false */) {
if (debug == 1)
Log.v("DEBUG_TAG", "MainAcitivy switchContent2");
transaction.addToBackStack(tag);
}
transaction.commit();
contentFragment = fragment;
}
HomeFragment is what is called A here.