Search code examples
androidandroid-6.0-marshmallowandroid-7.0-nougat

Why are the files downloaded by my app deleted after uninstalling it?


My application downloads files from Google Drive by the DownloadManager to the public Download directory. Everything works perfectly, except that when I uninstall my app, the downloded files are automatically deleted. Why?

  • my two test phones: 1 under Nougat and 1 under marshmallow

Is there something I did not follow and understood with Marshmallow and Nougat?

Thank you for enlightening me.


Solution

  • It's a real regression !! I had not noticed it yet.

    Solutions if you want your downloaded files to persist after uninstalling your app are:

    • 1 not to use DownloadManager :))
    • 2 rename your files after Download process
    • 3 move your files away

    Source:https://commonsware.com/blog/2016/02/09/changes-downloadmanager-behavior.html