Java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
when i try to remove fragment onStop after onSaveInstanceState got exception .
Original Code
when i try to remove fragment onStop after onSaveInstanceState got exception .
Original Code
ft = fm.beginTransaction();
ft.remove(fragment3);
ft.addToBackStack(null);
ft.commit();
Solutions
Instead of ft.commit change to ft.commitAllowingStateLoss();
ft = fm.beginTransaction();
ft.remove(fragment3);
ft.addToBackStack(null);
ft.commitAllowingStateLoss();
No comments:
Post a Comment