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)
Asked
Active
Viewed 106 times
-1

Abhishek Patel
- 4,280
- 1
- 24
- 38

Mehul
- 9
- 3
-
write your functionality inside the try{}catch(Exception e){} then you debug – MurugananthamS Jun 02 '16 at 13:39
-
Thanks muruga5000 i'll try it – Mehul Jun 02 '16 at 13:42
-
please if not able to give answer then please don't mark as negative – Mehul Jun 02 '16 at 13:47
-
post what you tried@Mehulsinh – MurugananthamS Jun 02 '16 at 13:52
-
@muruga5000 try catch is not feasible solution I have lots of code i didn't understand where to put it. – Mehul Jun 02 '16 at 13:56
-
which page or Activity you got error@Mehulsinh – MurugananthamS Jun 02 '16 at 14:00
-
if you debug line by line you still cant find the position ? – theo231022 Jun 02 '16 at 14:03
-
I have solved it by removing my super.onSaveInstanceState(saveInstance) – Mehul Jun 03 '16 at 10:13
1 Answers
1
Error is:
Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
This error is more related to method calling order. I meant, you probably called some method but activity/fragment is in a state where it can not process that method.
This can be caused also by a fragment transaction at wrong time.
That's why you don't find the line number in the log.
You can search for this error and you will see different root causes. This may at least guide you to find the problematic point.
Please, update your question with "onSaveInstanceState" method. This way, we can try to help you more.
Or share more code....
For now, use these answers as reference:
-
@Guliherme P Thanks for your reply , i have found my answer in your Question1 link. – Mehul Jun 02 '16 at 14:18
-