public void navigationToFragment(Fragment fragment, Bundle bundle, String strTitle){ String fragmentName = fragment.getClass().getName(); FragmentManager manager = getSupportFragmentManager(); boolean isFragmentPop = manager.popBackStackImmediate (fragmentName, 0); FragmentTransaction ft = manager.beginTransaction(); if (isFragmentPop) fragment=manager.findFragmentByTag(fragmentName); if (bundle!=null) fragment.setArguments(bundle); if (strTitle!=null) getSupportActionBar().setTitle(strTitle); ft.replace(R.id.container,fragment,fragmentName); ft.addToBackStack(fragmentName); ft.commit(); } navigationToFragment(new AlbumsGroupFragment(),bundle,model.name); This is how the method is called.
The problem is that if Fragment A is created, and then Fragment B, then after calling onBackPressed, Fragment A calls OnCreateView.
And I wanted the fragment A not to be created, but as if it came out of the stack. And then some kind of fiction is obtained