Android:使用DownloadManager从Internet下载文件并将其保存到内部存储器

Android:使用DownloadManager从Internet下载文件并将其保存到内部存储器,第1张

概述我正在使用DownloadManager从Web下载文件到我的 Android设备.我使用以下方法将此文件保存在SD卡上: DownloadManager.Request req = new DownloadManager.Request(Uri.parse("file path"));req.setTitle("file title").setDescription("Downloading 我正在使用DownloadManager从Web下载文件到我的 Android设备.我使用以下方法将此文件保存在SD卡上:

DownloadManager.Request req = new DownloadManager.Request(Uri.parse("file path"));req.setTitle("file Title").setDescription("Downloading ....") // download the package at the /sdcard/download path..setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,"file name"+ "file extension");

我想将它保存到内部存储.怎么做?

解决方法 使用此路径.setDestinationInExternalPublicDir(Environment.getExternalStorageDirectory()               “/AndroID/data/xxx.xxx.xxx/files/”) 总结

以上是内存溢出为你收集整理的Android:使用DownloadManager从Internet下载文件并将其保存到内部存储器全部内容,希望文章能够帮你解决Android:使用DownloadManager从Internet下载文件并将其保存到内部存储器所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1124564.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存