0
Comment puis-je ajouter un fragment et libérer toute la pile arrière d'Android en une action?Ajouter un fragment et libérer des fragments de pile en une seule action dans Android
J'ai essayé:
getSupportFragmentManager().popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE);
Puis ajouter mon nouveau fragment:
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left);
fragmentTransaction.replace(R.id.content_frame, fragment);
fragmentTransaction.commitAllowingStateLoss();
// or
fragmentTransaction.commit(); // i tried both of them
Mais je reçois:
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState