OK, this is a strange one that I didn't think was even possible.
So, ever since I've been using a Nexus 5X, the SharedPreferences are not getting wiped when I uninstall my app.
I install the app through Android Studio and test things. I then uninstall the app. I then resintall the app through Android Studio and all the SharedPreferences values are still there.
I've tried clearing the data/cache in addition to uninstalling. The SharedPreferences are persistent through all those attempts.
I am using stock Android 6.0 on a Nexus 5X. My device is not rooted. I am not using a custom ROM. I do not have this issue with my Nexus 4.
Any ideas what might be causing this?
The old shared preference value are cleared and totally wiped out after clearing the data app and uninstalling it, so the SharedPreference should be empty in the fresh start.
Android Shared Preferences Overview Android stores Shared Preferences settings as XML file in shared_prefs folder under DATA/data/{application package} directory. The DATA folder can be obtained by calling Environment.
Android's built-in SharedPreferences storage mechanism allows us to store information that persists throughout the entire app.
This is a new marshmallow feature.
Add android:allowBackup="false"
tag inside your <application>
object in your app manifest to disable this behaviour.
If android:allowBackup
tag clashes with any other library you are using, you should add tools:replace="android:allowBackup"
also.
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