1

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)

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
user583739
  • 33
  • 8

1 Answers1

0

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

Cheryl Simon
  • 46,552
  • 15
  • 93
  • 82
  • Did you read the link? It gives a very clear explanation of how to use shared preferences. – Cheryl Simon Jan 21 '11 at 17:16
  • Sorry, I don't have time to write your code for you. If you make an attempt with the given example and run into a specific problem then we can help you debug that issue. – Cheryl Simon Jan 21 '11 at 20:41