【发布时间】:2012-08-10 11:33:00
【问题描述】:
我的应用程序在某些用户设备上不断崩溃,在 Activity onStart 方法中出现以下异常:
Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1299)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1310)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:541)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:525)
at android.support.v4.app.DialogFragment.show(DialogFragment.java:123)
我无法在我的模拟器中本地重现此错误。我在stackoverflow上发现了一些关于这个问题的问题: here 和 here
我已经尝试了建议的解决方案,即在 onSaveInstance 中不允许在片段或活动中使用空包。
但是问题仍然存在。这是我收到的唯一一份崩溃报告,而且我不断收到它。
有人有可行的解决方案吗?
【问题讨论】:
标签: android illegalstateexception