【发布时间】:2018-08-03 07:20:45
【问题描述】:
我已经在一个活动中实现了 DownloadManager。下载工作正常。但是这个类会自动创建一个通知,它会留在状态栏中。有没有办法删除这个通知。下面是代码:
Uri uri = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setTitle(fileName);
request.setDescription(fileName);
request.setVisibleInDownloadsUi(false);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION);
firmwareZipPath = new File(Environment.getExternalStorageDirectory()
+ File.separator
+ Constants.TEST,
type + ".tgz");
request.setDestinationUri(Uri.fromFile(firmwareZipPath));
downloadId = downloadManager.enqueue(request);
我尝试给request.setVisibleInDownloadsUi 提供虚假信息。仍然显示通知。
【问题讨论】:
标签: android notifications download-manager