Krewie
Krewie

Reputation: 135

About SharedPreferences in android

i was just wondering, if i wanted to reset the actual preference file used with SharedPreferences could i just rename the preference file ? , wouldn't that mean that the file still exist or does overwrite it ?

Upvotes: 0

Views: 346

Answers (1)

yanchenko
yanchenko

Reputation: 57216

prefs.edit().clear().commit(); // prefs = SharedPreferences

is the proper way. Deleting the file with no referencing SharedPreferences objects should result the same.

Upvotes: 3

Related Questions