DownloadManager和Android 7.0取消功能

时间:2016-08-30 15:25:45

标签: android broadcastreceiver android-7.0-nougat

如果您使用 DownloadManager "取消" 功能>

他们是否添加了任何意图过滤器操作来捕获此事件?

此时,DownloadManager只获得3个动作:

  • ACTION_DOWNLOAD_COMPLETE

  • ACTION_NOTIFICATION_CLICKED

  • ACTION_VIEW_DOWNLOADS

我尝试使用ACTION_NOTIFICATION_CLICKED手动取消下载,但如果用户点击&#34;取消&#34; 按钮,我就不会收到通知。< / p>

1 个答案:

答案 0 :(得分:8)

如果用户点击“取消”,则DownloadManager应向您的应用发送ACTION_DOWNLOAD_COMPLETE广播。但它是Android N中的已知错误,Android团队正在研究它:

Issue 219785: DownloadManager dose't send ACTION_DOWNLOAD_COMPLETE broadcast while click CANCEL button on notification to cancel the downloading.

我们必须等待修复!