Android: Download Manager resume issue -
i trying download file using android download manager. per docs:
the download manager conduct download in background, taking care of http interactions , retrying downloads after failures or across connectivity changes , system reboots.
but, download manager never resumes download, after network connection restored(at least, in case). tried setting request header, using addrequestheader(). nothing worked. code follows:
request request = new request(uri.parse(base_url)); request.setallowednetworktypes(downloadmanager.request.network_wifi | downloadmanager.request.network_mobile); request.setallowedoverroaming(false); request.settitle("aarti sangrah.zip"); request.setdestinationinexternalpublicdir( environment.directory_downloads, "aarti sangrah.zip"); if (build.version.sdk_int >= build.version_codes.honeycomb) { request.setnotificationvisibility(request.visibility_visible_notify_completed); } else { request.setshowrunningnotification(true); } if (isresuming) { request.addrequestheader("range", "bytes=" + file.length()); } enqueue = dm.enqueue(request);
in docs, couldn't found method resuming downloads. also, have broadcastreceiver monitoring network changes.
Comments
Post a Comment