Fragment Onresume() And Backstack Issue
Solution 1:
Launch fragment A1, A2, A3 with childfragment manager from fragment A and launch fragment B with main fragment manager.
For Example : To perform any fragment operation we have two fragment manager, If you are performing any fragment operation within a fragment you should use getChildFragmentManager() inplace of getSupportFragmentManager().
Now here, to launch fragment A1, A2 and A3 you should use getChildFragmentManager() and When launching fragment B you should use getSupportFragmentManager(). So when you press back from fragment B you will get onResume callback in fragment A.
Solution 2:
When you have added your fragment B, have you added the transaction to the backstack with this command: addToBackstack(null); by this way, you can restore the previous state when you press back on fragment B and return to fragment A.
Post a Comment for "Fragment Onresume() And Backstack Issue"