I have an App that has a single Activity with a Navigation Drawer, which switches between many, many fragments. These Fragments obviously have UIs, so I shouldn't call setRetainInstance(true)
on them directly.
For data like Bitmaps which are too large to be stored in a Bundle with onSaveInstanceState()
, what is the recommended practice to save/restore their state? The Official Docs recommend that Activities save such data in UI-less Fragments. I also know it's possible to nest Fragments if needed, but is that recommended for cases like this? Should each UI Fragment really have a corresponding data retention fragment class? Or (perhaps even worse), a monolithic data retention class for all UI Fragments to share?
It just seems like there has to be a better way.