Artem Artem - 9 months ago 71
Android Question

How to remove SharedPreferences when I remove app on Android 6

When I delete app from a device with standard removing-methods (drag-and-drop for example) my

doesn't clean.


How to clean my

P.S. If I clear data in
cleaned, but this isn't a solution for me.


How to clean my SharedPreferences?

What are you experiencing is the default behavior of allowBackup, whch is true by default. From the documentation:

Whether to allow the application to participate in the backup and restore infrastructure. If this attribute is set to false, no backup or restore of the application will ever be performed, even by a full-system backup that would otherwise cause all application data to be saved via adb. The default value of this attribute is true.

if you want to disable it add allowBackup="false" to the Application tag on your AndroidManifest. This way the SharedPreferences won't be restored