DownloadManager and Android 7.0 Cancel feature

坚强是说给别人听的谎言 提交于 2019-12-11 04:28:50

问题


Android N brought the "cancel" feature directly on the download notification if you're using the DownloadManager.

Did they add any intent-filter action to catch this event ?

At this point DownloadManager gets only 3 actions :

  • ACTION_DOWNLOAD_COMPLETE

  • ACTION_NOTIFICATION_CLICKED

  • ACTION_VIEW_DOWNLOADS

I tried to use ACTION_NOTIFICATION_CLICKED to cancel manually my download but if the user clicks on the "Cancel" button, I'm not notified.


回答1:


The DownloadManager should send ACTION_DOWNLOAD_COMPLETE broadcast to your app if user click on Cancel. But it is a known bug in Android N, Android team is working on it:

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

We have to wait for fix!



来源:https://stackoverflow.com/questions/39231544/downloadmanager-and-android-7-0-cancel-feature

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!