Vegas
Vegas

Reputation: 8917

Do changes made with SharedPreferences.Editor survive a device reboot?

If an application stores something using SharedPreferences.Editor's methods, does it survive a device reboot?

Upvotes: 1

Views: 52

Answers (2)

Wisdom Mbila
Wisdom Mbila

Reputation: 1

Yeah.. Though shared preference data are temporary and not a recommendation for saving long term or complex data but it values can only be cleared using Editor.clear ones commit() or apply()

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006819

If you commit() or apply() the changes that you make in the SharedPreferences.Editor, then yes. SharedPreferences are saved in an XML file, and that file will survive an ordinary reboot.

Upvotes: 1

Related Questions