How to recreate a activity with last used fragment

408 Views Asked by At

I have a fragment say FRAG A in my activity, now i have added one more fragment on top of it say FRAG B. Now i want to recreate the activity with FRAG A and FRAG B. But the fragments should go through the config changes means it should reload or recreate.

1

There are 1 best solutions below

0
On

Just have save a boolean in shared preference. If boolean is false reload Frag A and if its true reload Frag B. Depending on where the user left off use can store Shared preference. I am assuming that you want to recreate last seen fragment on app closed and then opened.