Search code examples
androidmenusaveinstant

Saving Option Menu InstateState Android


I have an option menu when the activity looses focus the selected option menu item(s) retain state but when my activity is destroyed all the options are reset.

How can I save the state of the selected preference after resuming from a destroyed state? Having problem visualizing how to implement [Shared Preferences][1] for the code.

(Only needed for the boolean values but I have included the static menu items)


Solution

  • You probably want to create some shared preferences. Those, and other data storage options are described in Data Storage.