8
scout
7y

Android fragments are so damn stupid. They reload on popBackStack, how the f do I retain them? Tried so many things from stackoverflow but no luck yet. So many precious hours going waste on little things.

Comments
  • 2
    @No-one AFAIK the normal fragment only will be RESTORED, it means after restored it's not the same reference to previous, that's why fragment require a constructor with no argument. But if you use "setRetainInstance(Boolean)" function set true, its life cycle is different to normal fragment, and you get same reference when restoring.

    Hope it can help you.
  • 2
    Thank you for the pointers guys. I was using the setRetainInstance(true) but that was it, expected it to restore itself. Now I'll research how to restore onResume Or something.
Add Comment