Solution 1 :
There is an android:allowBackup
attribute available for <application>
that controls whether the app’s data can be backed up automatically by the OS. If this attribute is set to true
and the app is reinstalled, a backup of its data is restored. During development, this can be a pain. And, in production, neither you nor the users have much control over the backup process.
If you wish to disable this — for debug
builds or all builds — set android:allowBackup="false"
on <application>
in the appropriate edition of the manifest (e.g., src/main/
for all builds, src/debug/
for debug
builds).
Problem :
Title pretty much says it all.
I created files in internal storage with the path from getFilesDir()
with the idea that they should be deleted when the app gets uninstalled. But they are not being deleted at all.
If I want to delete the data I have to do it manually in my phones applications settings, or manually delete the files out with the device file explorer in Android Studio. This is not ideal.
Can anyone help?
Comments
Comment posted by blackapps
Hard to believe as they should be removed at uninstall. You have any special device under which Android version?
Comment posted by CommonsWare
“If I want to delete the data I have to do it manually in my phones applications settings” — how exactly are you doing this? If your app was uninstalled, there is no spot for your app in the Settings app. If your concern is that the files seem to be there after you
Comment posted by Adam Paul
@CommonsWare I “Clear Data” and “Clear Cache” in the app setting before I uninstall it. That the only way I can delete them.
Comment posted by Adam Paul
Just notice other weird behavior. After I clear the data manually and uninstall, then reinstall, the files re-appear. Its like they are getting pushed to the phone every time I install. Is that possible? How do I stop that?
Comment posted by Adam Paul
@CommonsWare That work! Thanks a ton!