4

App throws below exception at random time and in radom devices. I am not getting when it is coming actually. I just got too many crash reports on fabric of this.

Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
       at android.support.v4.app.FragmentManagerImpl.checkStateLoss(Unknown Source)
       at android.support.v4.app.FragmentManagerImpl.modifiesAlpha(Unknown Source)
       at android.support.v4.app.BackStackRecord.dump(Unknown Source)
       at android.support.v4.app.BackStackRecord.dump(Unknown Source)
       at com.example.MyAcvitity.ShowDialogBox(Unknown Source)
       at com.example.MyAcvitity.ShowDialogBox(Unknown Source)
       at com.example.MyAcvitity$3.handleMessage(Unknown Source)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5351)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)

I have tried..

@Override
    protected void onSaveInstanceState(Bundle outState) {
        //No call for super(). Bug on API Level > 11.
        // override this method to avoide (java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState) this exception

    }

but still its giving the same exception.

MyActivity contains fragments. How do I come out from this?

Mayank Pandya
  • 265
  • 3
  • 14
  • Please see this question it is similar to your problem.It might help you. http://stackoverflow.com/questions/7575921/illegalstateexception-can-not-perform-this-action-after-onsaveinstancestate-wit – Umair Apr 04 '17 at 06:32
  • @Umair I have seen that and already taken the action as per the accepted answer.. Please check that I have tried that thing as mentioned above, by overriding onSaveInstanceState() method without calling super. but it doesn't fix this issue. – Mayank Pandya Apr 04 '17 at 06:38
  • Have the same exception. Do you find a fix? – Jérémy Reynaud Jul 04 '17 at 14:17

0 Answers0