pause/resume download in my activity by com.mozillaonline

431 views Asked by At

I'm using open source project for download files

https://github.com/JiboStore/DownloadProvider

This library worked correctly,
For example this code starting download and show list with pause/resume feature:

DownloadManager mDownloadManager = new DownloadManager( getContentResolver(), getPackageName()); String url = "...."; Uri srcUri = Uri.parse(url); DownloadManager.Request request = new Request(srcUri); request.setDestinationInExternalPublicDir("MyApp" + File.separator + "Download", "test.txt"); request.setDescription("For test"); request.setTitle("test.txt"); mDownloadManager.enqueue(request);

But I don't know how to use pause/resume within my activity or access to the contents list of downloads for diagnosis item has been paused.

1

There are 1 answers

1
Naruto Uzumaki On

You must in the first access to your downID within database, then handle pause/resume with this:

mDownloadManager.pauseDownload(downID);
mDownloadManager.resumeDownload(downID);