我收到 java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState 。当我执行 fragmentManager.popBackStack() 时。这次崩溃是随机的。我没有在我的活动中覆盖 onSaveInstanceState()。
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();
}
}
}
}
}
});