SharedPreferences class allows to save application data in simple type (boolean, String, etc.) formats.
Normally they are not removed and they are supposed to persist, but are they removed in case such as when application is updated/removed or application cache is cleared?
when you do clear data
from the device applications manager
or when you uninstall your application, the SharedPreference's file is deleted.
SharePreferences are stored inside
/data/data/packagename/shared_prefs/prefsname.xml
unless you have the android:allowBackup="true"
in your manifest. In that case they might be restored.
Sharedpreferences
will clear when you clear application data from Application manager by force.
If you want to clear your application Sharepreference data, then you can use:
PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commit();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With