Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1500)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1518)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:634)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:613)
at android.support.v4.app.FragmentTabHost.onAttachedToWindow(FragmentTabHost.java:282)
at android.view.View.dispatchAttachedToWindow(View.java:12779)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2592)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2599)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1063)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5993)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)
答案 0 :(得分:1)
错误是:
Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
此错误与方法调用顺序更相关。我的意思是,你可能调用了一些方法,但是活动/片段处于无法处理该方法的状态。
这也可能是由错误时间的片段事务引起的。
这就是为什么你没有在日志中找到行号。
您可以搜索此错误,您将看到不同的根本原因。这至少可以指导您找到问题点。
请用" onSaveInstanceState"更新您的问题方法。这样,我们可以尝试为您提供更多帮助。
或分享更多代码......
目前,请将这些答案用作参考: