Is there a Pause action for download manager in Android?

I am using the download manager class in android to download some files. This class can add and remove a download request.

Is there a way to pause a specific download and then resume it?

Or is there any other way to do this?

Edit: I found this method, it works:

  • When pausing the download process, close the file we wrote.
  • When downloading resumes, access to the file (not completed) and its size
  • Add the downloaded byte data to the httpRequest header: mHttpRequset.setHeader ("Range", "bytes =" + mPreviouslyDownloadedBytes + "-");
  • mHttpClient.execute (mHttpRequset);
+6
source share

Source: https://habr.com/ru/post/944128/


All Articles