Resume download from Download Manager android when download is failed

I am using DownloadManager service to download files. I want it to resume the download if it is failed by any case(for example internet got disconnected). I am saving the download id generated when we enqueue the request for download. Can I resume download using that id? Or with any other method?

EDIT: Code of my Download Service: http://pastie.org/8613353


It's good habit to check documentation first. DownloadManager documentation says:

The download manager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots.


Thanks to @Marcin's suggestion, I checked the documentation for DownloadManager. The problem with the link I posted was that it was not having resume capability. That's why after it failed due to internet disconnection, it won't resume. I tried other links with resume capability, and they all resume perfectly after internet re-connection.

链接地址: http://www.djcxy.com/p/76772.html

上一篇: 使用jQuery UI将可拖动元素排序在可拖放内

下一篇: 下载失败时,从Download Manager android继续下载