与下载管理器一起使用公共下载文件夹
我正在尝试从firebase下载一些文件,所以我创建了此methode
private void downloadFile(String url, String destination,String fileName,String fileExtension)
{
DownloadManager downloadManager = (DownloadManager) context.getSystemService(context.DOWNLOAD_SERVICE);
Uri uri = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalFilesDir(context,destination,fileName+"."+fileExtension);
downloadManager.enqueue(request);
}
,但是这些文件并未保存在公共下载文件夹中,它保存在android/data/apppackageName/apppackagename/files/files/storage/emulation/emulation/0/下载
i'm trying to download some files from firebase so i created this methode
private void downloadFile(String url, String destination,String fileName,String fileExtension)
{
DownloadManager downloadManager = (DownloadManager) context.getSystemService(context.DOWNLOAD_SERVICE);
Uri uri = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalFilesDir(context,destination,fileName+"."+fileExtension);
downloadManager.enqueue(request);
}
but the files isn't saved in the public download folder it saved in Android/data/appPackageName/files/storage/emulated/0/Download
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论