Download to internal memory possible?

后端 未结 1 977
我在风中等你
我在风中等你 2020-12-06 16:34

I am using downloadmanager.request enqueue setDestinationUri to download files.

Is it possible to download the files to the internal memory location of

相关标签:
1条回答
  • 2020-12-06 16:56

    It is unlikely that DownloadManager will be able to do this. My assumption is that DownloadManager does not run in your process, but in another process controlled by the system. Internal storage locations are permissions protected and any location that you would provide would be accessible only to your application.

    It seems like you have two options.

    (1) Supply a file path on "external" storage, when it completes, copy to internal storage, and then delete the file on external storage.

    (2) Create a ContentProvider which DownloadManager can write to and give it a URI that corresponds to this ContentProvider. The ContentProvider that you implement can write the file to internal storage since it will run in the context of your application.

    0 讨论(0)
提交回复
热议问题