0

when i add a Fragment statically in the Activity layout, i can't seem to be able to recover the state in onViewStateRestored(savedInstanceState: Bundle) even though onSaveInstanceState(outState: Bundle) is called correctly.

It works for the same Fragment, when i add it dynamically.

Is this simply not possible to do this or does it require additional configuration in the Manifest or w/e

EDIT: onViewStateRestored(savedInstanceState: Bundle) will be called, but the Bundle is null, as well as in other Lifecycle callbacks that pass the Bundle through

VVB
  • 7,363
  • 7
  • 49
  • 83
Flo We
  • 325
  • 2
  • 12

1 Answers1

-1

You should post also the code where you add your fragment, not sure what you mean by statically add a fragment.

Please check out also this answers:

If still don't figure it out, paste your code.