I have a SharedPreference that counts the amount of launches of my App. I expect this to be 0, when I install my app. Nevertheless it is 14. The same strange behaviour I observe with my database, that already exists on a fresh install.
I didn't intent to recycle my app data (like in the Google Cloud). On my device in the account settings the app-data sync is on. If I turn it off, and make a reinstall I observe the same behaviour.
Anyone has every observed such a behaviour? Is there any way to prevent recycling old data and force a proper install?
In Android Marshmallow Google introduced the "Auto Backup" feature which is turned on by default if your targetSdkVersion is >=23.
This will back up your database and SharedPreferences by default and restore it when you re-install the application. To turn this feature off you have to add android:allowBackup="false"
to your AndroidManifest.xml
.
More info here: Auto Backup for Apps
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