Search code examples
androidsharedpreferencesandroid-update-app

sharedpreferences are cleared on update to new version when using android:allowBackup="false" in Manifest?


I have face strange issue on my app, sharedpreferences are cleared when I update the new version of apk.

I have used false for android:allowBackup. is this the reason ? if no, what I need on app side to keep my exiting preferences?

Thanks in advance


Solution

  • I don't have enought reputation to post a comment, sorry.

    I think your issue is not related to that Manifest attribute, since what it does is to allow the device to include your app info for backups. Little info here.

    Could you post how you access to your shared preferences? It's important to access the same preferences, so is it posible that your preferences id is composed with your application version or something similar? Just guessing, i'll try to be more helpful once you post the code :)