0

See above.

I need to dismiss a dialog when the user cancels a download from their notification bar. What does DownloadManager broadcast when that happens?

enter image description here

J. Chan
  • 77
  • 2
  • 12
  • Where do we see? – MMG Apr 06 '20 at 05:42
  • Do you mean the download? – J. Chan Apr 06 '20 at 05:45
  • It is explained here. https://stackoverflow.com/a/14088174/5582190 – Jaymin Apr 06 '20 at 05:46
  • Do you attach any image? – MMG Apr 06 '20 at 05:46
  • Uploaded an image of what I mean by cancelling a download in the notifications. @Jaymin I want to know whether the download has been cancelled. The answer seems to be about removing a download from the queue. – J. Chan Apr 06 '20 at 06:00
  • 1
    @J.Chan, `android.intent.action.DOWNLOAD_COMPLETE` broadcast is sent not only for completed download, but it is also sent when you cancel the download. – Jaymin Apr 06 '20 at 06:09
  • @Jaymin Thank you. I checked it out and it does receive an intent from DOWNLOAD_COMPLETE. How to check that the download has been cancelled though? The COLUMN_STATUS still indicate STATUS_RUNNING in the receiver. – J. Chan Apr 06 '20 at 06:39
  • Additionally, the log says that "Stop requested with status HTTP_DATA_ERROR" and the DownloadManager finishes with "Finished with status WAITING_TO_RETRY". Should I be checking for those? Is there no direct way of checking whether the user cancels a download? – J. Chan Apr 06 '20 at 06:43
  • You can mange by keeping track of all download files and status or you can integrate the 3rd party library which provides all the use-cases that you want. – Jaymin Apr 06 '20 at 06:49

0 Answers0