方法不能在onSaveInstanceState方法后调用 否则发生崩溃详情请看 的区别
如果使用方法;可以解决崩溃问题,
如果使用方法 当生命周期方法的onSaveInstanceState()执行过后,会发生崩溃日志如下:
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1341) at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1352) at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:595) at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:574)