java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState

google.com | 1 month ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola . Or join the community to write better ones.
  1. 0
    samebug tip
    If you're using nested fragments, you have to use childFragmentManager instead of fragmentManager.
  2. 0
    samebug tip
    You can't use hide() or remove() or many things with NULL values, try checking for NULL before calling this methods.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0
    samebug tip
    Also, check if you're not using android.support.v4.app.FragmentTransaction with android.app.Fragment and vice-versa
  5. 0

    FragmentManager IllegalStateException on transaction commit ยป

    nu-no.nl | 1 year ago
    java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    Can not perform this action after onSaveInstanceState

    at android.support.v4.app.FragmentManagerImpl.checkStateLoss()
  2. Android Support v4
    BackStackRecord.commit
    1. android.support.v4.app.FragmentManagerImpl.checkStateLoss(SourceFile:1493)
    2. android.support.v4.app.FragmentManagerImpl.enqueueAction(SourceFile:1511)
    3. android.support.v4.app.BackStackRecord.commitInternal(SourceFile:634)
    4. android.support.v4.app.BackStackRecord.commit(SourceFile:613)
    4 frames
  3. com.my.package
    LoginFragment1$1.onClick
    1. com.my.package.ui.activities.LoginActivity.onRegisterClicked(SourceFile:94)
    2. com.my.package.ui.fragments.LoginFragment1$1.onClick(SourceFile:114)
    2 frames
  4. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:4278)
    2. android.view.View$PerformClick.run(View.java:17430)
    3. android.os.Handler.handleCallback(Handler.java:725)
    4. android.os.Handler.dispatchMessage(Handler.java:92)
    5. android.os.Looper.loop(Looper.java:213)
    6. android.app.ActivityThread.main(ActivityThread.java:5092)
    6 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Method.java)
    2. java.lang.reflect.Method.invoke(Method.java:511)
    2 frames
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:564)
    2 frames
  7. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(NativeStart.java)
    1 frame