David Guo
David Guo

Reputation: 1759

How to pause a download item from DownloadProvider?

I have check the document about DownloadManager, but I can not find the API to pause the download item. in my app, user can manage the download task. I know how to cancel the download item, but it seems there is no way to pause/resume the download item.

Do I have to write the download by myself? it seems reinvent the wheel.

Upvotes: 1

Views: 1819

Answers (1)

Nikolay Elenkov
Nikolay Elenkov

Reputation: 52936

Since there is no API for this, you can't directly do it. The download manager works asynchronously, so pausing/resuming doesn't really fit this model. You request a file, it is downloaded in the background, you get notified when it's done. What do you have to gain by pausing/resuming anyway?

Technically, if you request a download over WiFi only, and then disable WiFi from your app, the download will be paused. But you probably don't want to do this.

Upvotes: 3

Related Questions