I have fragments I keep in the backstack of FragmentManager. Every fragment state is saved for orientation changes with member variables, like this for example:
<
I think the proper solution is to read those member variables out of savedInstanceState
in onCreate
which seems to be called always before onSaveInstanceState
. If you process the fields in onViewCreated
, they don't have the chance to get initialized before the next onSaveInstanceState
(in this special case, when Fragment is in the backstack).