问题
I am getting java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState . When I did fragmentManager.popBackStack(). This crash is random . I am not overriding onSaveInstanceState() in my activity.
Navigator.post(new Runnable() {
@Override
public void run() {
if (actRef != null && actRef.get() != null) {
if (isLastFragment()) {
finish();
} else {
if (fragMngr != null) {
try {
fragMngr.popBackStack();//crashing in this line
/**
* check if it is last fragment
*/
if (isLastFragment()) {
finish();
}
} catch (IllegalStateException ignored) {
ignored.printStackTrace();
}
}
}
}
}
});
来源:https://stackoverflow.com/questions/49017470/can-not-perform-this-action-after-onsaveinstancestate-android