开发者

Saving Option Menu InstateState Android

开发者 https://www.devze.com 2023-02-05 15:59 出处:网络
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.

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 implem开发者_如何转开发ent [Shared Preferences][1] for the code.

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消