I\'m currently working an application that should have the following behavior : In one of the activities, the user can select different items into a list. While doing that,
I know I could use the Bundle savedInstanceState to manually save and restore the state by overriding onPause, onResume, on Create (etc), but there is actually lots of data in custom components that are not easily serializable, so I'd like to avoid that.
What you would "like" does not much matter. You need this code anyway to handle configuration changes (e.g., switch from portrait to landscape). Please implement onSaveInstanceState()
and onRestoreInstanceState()
, then back out all the rest of the inappropriate hacks that you have in your previous paragraph (e.g., singleInstance
, alwaysRetainTaskState
).