Since the deprecation of onRetainNonConfigurationInstance
I have been leveraging the framework more and more for Configuration changes. Since I use the ViewPager to hold my main Fragments I cannot use setRetainInstance
, which limits my Configuration changes to use onSaveInstanceState like a standard Activity or View would.
It is working perfectly without any problems but I am at the moment passing a quite sizable Serializable dataset through it that makes me want to get the communities input on whether or not it is a good idea.
tl;dr : Does onSaveInstanceState have a size limitation on what you pass through it?
SharedPreferences
-- I guess that.setRetainInstance()
with fragments in aViewPager
? I cannot find any place that cites this limitation. Got a link? Thanks!FragmentPagerAdapter
andFragmentStatePagerAdapter
and neither resulted in the Fragments working correctly withsetRetainInstance()
. When I moved them from theViewPager
to a standard switch similar to (see below) everything worked correctly. developer.android.com/resources/samples/Support13Demos/src/com/…