I am working with fragments
and the navigation flow like
Fragment A -> Fragment B -> Fragment C -> Fragment D
Form fragment
D I need to navigate to fragment
A by clearing back stack but the problem is in onCreateView()
method of fragment
C I am showing one dialog
When I am navigating from D to A by clearing the back stack Over fragment
A same pop-up appears which was shown in on fragment C
below is the code I am using to clear the stack
FragmentManager fm = getActivity().getSupportFragmentManager();
for (int i = 0; i < fm.getBackStackEntryCount(); ++i) {
fm.popBackStack();
}