Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear back stack #31

Open
r2bapps opened this issue Oct 16, 2014 · 0 comments
Open

clear back stack #31

r2bapps opened this issue Oct 16, 2014 · 0 comments
Assignees

Comments

@r2bapps
Copy link
Owner

r2bapps commented Oct 16, 2014

Test this option:

private void doSwitchToMenuItem(MenuItem item, SlideMenuFragment fragment) {
sideMenuFragment.highlightItem(item);
getSupportFragmentManager().popBackStack(ROOT_FRAGMENT_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.content_frame, fragment);
transaction.addToBackStack(ROOT_FRAGMENT_TAG);
transaction.commit();
getSlidingMenu().showContent();
}

old clear throws:
java.lang.RuntimeException: Unable to resume activity {com.axa.health.fr/com.axa.health.app.MainActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2946)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2975)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1354)
at android.support.v4.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:492)
at com.axa.health.app.MainActivity.clearBackStack(MainActivity.java:268)
at com.axa.health.app.MainActivity.captureNotifications(MainActivity.java:13

@r2bapps r2bapps self-assigned this Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant