我有一个看起来像这样的日志,原因是什么以及如何解决这个问题请建议
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(SourceFile:1343)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(SourceFile:1354)
at android.support.v4.app.BackStackRecord.commitInternal(SourceFile:595)
at android.support.v4.app.BackStackRecord.commit(SourceFile:574)
at android.support.v4.app.DialogFragment.dismissInternal(SourceFile:189)
at android.support.v4.app.DialogFragment.dismiss(SourceFile:155)
at com.replicon.cloudclock.timeoff.view.TimeOffActivity$5.run(SourceFile:1264)
at java.util.Timer$TimerImpl.run(Timer.java:284)
这里显示的是我遇到问题的代码片段
final Timer dismissTimeOut = new Timer();
dismissTimeOut.schedule(new TimerTask() {
@Override
public void run() {
timeOffDialogFragment.dismiss();
dismissTimeOut.cancel();
}
}, 2000);