Error in Android boot manager

Using the Android Download Manager, I try to perform multiple downloads of PDF files synchronously (i.e., a request instance is created after the successful completion of the previous request), shortly after notifying DOWNLOAD_SUCCESS in the broadcast receiver, a duplicate copy of the same request (with the same request identifier) ​​and DownlaodManager starts implicitly. The second time the download fails, and DownlaodManager gives DownloadManager.status = ERROR CAN NOT RESUME.Hence, pdf does not load. This only happens when I try synchronized multiple downloads. Any help is appreciated.

+5
source share
2 answers

I noticed that if you start a new download right after the current ends, this error will occur. So, I solved this problem by inserting sleep time into the current thread between the finish line and the start of the next boot ... I used Thread.sleep (1000), but you can try other values. (make sure you do not do this in UIThread). Works well for me;)

+1
source

Are you using your application on a Samsung device? I have the same problem with Nexus S, Galaxy Tab 10.1 and a name that I can’t remember (they have Android versions 2.3.6, 3.2 and 4.0.4), but never on HTC Nexus One, HTC Sensation (4.0.x) and HTC Explorer (2.3.5) or an emulator.

I have this consequence:

06-05 17:42:26.756: INFO/DownloadManager(12113): Initiating request for download 1551
06-05 17:42:27.057: INFO/ololo(17021): Status for content://downloads/my_downloads/1551: file exists
06-05 17:42:27.137: INFO/DownloadManager(12113): Initiating request for download 1551
06-05 17:42:27.197: WARN/DownloadManager(12113): Aborting request for download 1551: Trying to resume a download that can't be resumed
06-05 17:42:27.247: WARN/ImageView(17021): Unable to open content: content://downloads/my_downloads/1551

I think this is a very interesting problem.

, Samsung . - DownloadManager - .

0

All Articles