0

as stated in the title, I want to avoid the recreation of a DialogFragment when the app is sent in the backgroud and restored or at least save the stuff I need to be restored later. Unfortunately I can't use savedInstanceState because I also want to maintain references to adapters and stuff like that.

any idea how to do this?

jack_the_beast
  • 1,838
  • 4
  • 34
  • 67
  • 1
    Unfortunately the system doesn't work the way you desire. You must be prepared to entirely re-create your activity's "last state", based on saved instance state, and the lifecycle callbacks, e.g. onStart, onResume etc. As long as you acquire adapters, etc. in those methods, you get what you need. Current selections, etc get saved/restored in instance state. – escape-llc Nov 03 '15 at 12:21
  • ok, it's actually way more complicated, since the data comes from another fragment it's not so easy to restore it, maybe I'll have to redesign the whole thing. thank you – jack_the_beast Nov 03 '15 at 13:55
  • The activity will help u restore all.Do u use DialogFragment as Fragment ? – tiny sunlight Nov 04 '15 at 01:29
  • no, it doesn't. th dialogfragment is instantiated by another fragment btw – jack_the_beast Nov 04 '15 at 08:11

0 Answers0