I store my users’ login information in shared preferences,
But if the user deletes the app and reinstalls, the same information is still stored and user is logged in with the previously stored info,
It seems like the shared preferences doesn’t get cleared if the app gets deleted.
I have this problem with android 14
3
Answers
Try adding this to your AndroidMenifest:
Setting this attribute false will disable the auto backup of your Shared Preferences.
Check this to know more about allowBackup attribute.
In your
<application>
object inside your app manifest, try addingandroid:allowBackup="false"
tag to disable this behaviour.If
android:allowBackup
tag clashes with any other library you are using, you should addtools:replace="android:allowBackup"
also.I think its android feature.
Hope this helps.
Android might be restoring the app’s data using Auto Backup when the app is reinstalled. By default, Auto Backup includes files in the app’s internal storage, including SharedPreferences.
To disable Auto Backup and ensure SharedPreferences data does not persist after uninstall, add the following to your AndroidManifest.xml file:
<application
android:allowBackup="false"
android:fullBackupContent="false"
… >
android:allowBackup="false" ensures that no data, including SharedPreferences, will be backed up to Google Drive.
android:fullBackupContent="false" disables backup for all files