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



Question:

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 boxes can stay in their previous states. What's the correct way to save these states? Should I use SharedPreference.

Thanks.


Solution:1

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

Hope that helps.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »