0

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.

andinrajesh
  • 575
  • 2
  • 9
  • 24
  • elaborate with an example if you can... – Nike15 Feb 26 '16 at 11:54
  • explain something more – Amit Vaghela Feb 26 '16 at 11:54
  • please tell why you want to recreate ? do you want to stop activity to recreate when orientation is changed ? – Khizar Hayat Feb 26 '16 at 11:56
  • I am supporting multiple languages in my app. If a person changes the language whole app should be updated with new language and this includes all the api call i already made. So recreating the activity which will help me pull the data from server in the new language as well changes the local strings. – andinrajesh Feb 26 '16 at 12:04

1 Answers1

0

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.

Ragesh Ramesh
  • 3,470
  • 2
  • 14
  • 20