0

Fragment is working properly on orientation change in case if i didn't switch between the activity(fragment to non fragment activity) But if i follow the below mentioned steps getting fragment called twice.

Steps are:-

  1. Display a fragment and then click on a button and go to a another activity(which is not a fragment).
  2. Coming back to that fragment and then changing the orientation cause calling fragment twice.

So with this the problem is Loss of data saved in saved instance state.

Thanks in Advance.

zero323
  • 322,348
  • 103
  • 959
  • 935
  • By Default, Orientation changes call your oncreate method, thats why fragment recreates on orientation changes. Check this link to avoid recreation on Orientation changes. http://stackoverflow.com/questions/3097909/android-orientation-change-calls-oncreate – Ahmad Raza Nov 08 '13 at 11:17
  • @AhmadRaza as i stated above its working properly on the orientation change if i switch between fragments but it didn't work if i switch from fragment to another activity and then came back on fragment and change the orientation. – user2488684 Nov 09 '13 at 03:55

0 Answers0