开发者

What's the correct way to save state of an Activity

I have an Activity, which contains a bunch of check boxes and a submit button.

When the submit button is clicked, the activity will exit (finish() will be called). Before the activity exits, I want to save the states of the check boxes in the activity, so when the activity starts again, the check b开发者_开发百科oxes can stay in their previous states. What's the correct way to save these states? Should I use SharedPreference.

Thanks.


Yes, I believe SharedPreference is the best option.
You can check for more information at android page.

Hope that helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜