Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force delete application data on uninstall (Android)?

Tags:

android

There is a strange function in some Android devices (at least Galaxy S7): they restore data (for example the SQLite database) when the application is reinstalled. This behavior interrupts my app because the data is supposed to be deleted during uninstallation.

How can I force Android to completely delete all that data when the app is manually uninstalled?

like image 357
Vitaly Avatar asked May 06 '26 19:05

Vitaly


1 Answers

You have to disable the backup from AndroidManifest.xml

android:allowBackup="false"
tools:replace="android:allowBackup"

N.B: If you use any third party library that use android:allowBackup="true" then it conflicts and give error. To resolve this and override the setting you also have to add tools:replace="android:allowBackup".

like image 52
Md. Asaduzzaman Avatar answered May 09 '26 10:05

Md. Asaduzzaman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!