【发布时间】:2017-11-23 20:46:30
【问题描述】:
DownloadManager.Request downloadRequest = new DownloadManager.Request(Uri.parse(f_url[0]));
downloadRequest.setTitle(Application.getApplication().getString(R.string.app_name));
downloadRequest.setDescription("Saving..");
downloadRequest.setDestinationInExternalPublicDir(path,filename);
downloadRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager manager = (DownloadManager) Application.getApplication().getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(downloadRequest);
如果我将下载设置到外部目录,上面的代码在文件下载完成时不显示通知(它在进行中显示)。
当我评论下面的代码行时,它工作正常
//downloadRequest.setDestinationInExternalPublicDir(path,filename);
为什么会发生这种情况,有什么办法可以解决。
【问题讨论】:
-
你有没有解决办法?
标签: android notifications android-download-manager