3

I started using android DownloadManager and noticed that when a download completes I get between 2-4 broadcasts of ACTION_DOWNLOAD_COMPLETE and each is with reason STATUS_SUCCESSFUL for the same download ID....its smells like a bug? is there a solution for this?

thanks.

joseRo
  • 1,337
  • 3
  • 18
  • 35
  • Related/dupe: [DownloadManager.ACTION_DOWNLOAD_COMPLETE broadcast receiver receiving same download id more than once with different download statuses in Android](http://stackoverflow.com/q/8937817) – blahdiblah Feb 18 '14 at 20:29

1 Answers1

0

This was the exact issue i faced back then

Seeing this as well. For me it's like this:

Download is started and seems to complete ok, I get the DOWNLOAD_COMPLETED broadcast. However, right after this I see DownloadManager logging:

I/DownloadManager( 5893): Initiating request for download 1419 W/DownloadManager( 5893): Aborting request for download 1419: Trying to resume a download that can't be resumed

Then I get another DOWNLOAD_COMPLETED with the same download ID. Also, it seems the downloaded file gets deleted during this second, failed attempt.

Any ideas what triggers this? Or any workarounds? Or is everyone just writing their own download managers...

Reported to google; here

I tried to figure out a way to work around this issue. But it was hard and costed alot. So i threw away all my work with DownloadManager and started coding my custom downloader. DownloadManager back then proved to be a pain.

A solution suggested for the issue is to use this free, open source third party downloader in github

I'm not sure that it will work as you expect, it might have the same problem. I didn't try, but i hope it helps

Saro Taşciyan
  • 5,210
  • 5
  • 31
  • 50