问题
I'm using download manager class in android to download some files . This class can add and remove a request of downloading .
Is there any way to pause a specific download then resume it ?
Or Is there another way to do that ?
Edit: I found this way, It's working:
- When pause downloading process, close the file we wrote on.
- When resume downloading, access to the file (not completed) and get its size
- Add downloaded bytes info to the header of httpRequest : mHttpRequset.setHeader("Range", "bytes=" + mPreviouslyDownloadedBytes + "-");
- mHttpClient.execute(mHttpRequset);
来源:https://stackoverflow.com/questions/16340376/is-there-pause-action-for-download-manager-in-android