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">