How to pause and resume DownloadManager

RealDream picture RealDream · Feb 27, 2014 · Viewed 12.9k times · Source

I know this question is duplicated, I haven't got complacent answer. I am using Android System DownloadManager to download file from net work, it works fine with downloading file.

 private DownloadManager downloadManager;
 Button start;
 Button pause;
 Button resume;

initializing all the buttons above

downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
Uri Download_Uri = Uri
                .parse("uri");
DownloadManager.Request request = new DownloadManager.Request(
                Download_Uri);

then it has been put download queue. when turn is coming it begin downloading

my problem is, is there any simple way to pause download and resume download like

downloadManager.pause();
downloadManager.resume();

Thanks in advance.

Answer