After uninstalling the Android app, the SharedPreferences data still exists after reinstalling it.

Documentation: https://developer.android.com/guide/topics/data/backup

Reason: After the APP is uninstalled, the SharedPreferences data will be deleted together. However, after reinstalling the APP, the data is restored again, so it feels like the SharedPreferences data is still there.

There is a configuration in AndroidManifest.xml:

<application
        android:allowBackup="true">

What this means: Your data (sharedprefs and others) will be saved in Google Cloud and restored the next time you install the app.

Solution: Change AndroidManifest.xml to: android:allowBackup: false

<application
        android:allowBackup="false">

Guess you like

Origin blog.csdn.net/Jason_HD/article/details/126778684