Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to auto resume download and show custom notification? #2

Open
aazam-nouri opened this issue Nov 28, 2018 · 5 comments
Open

how to auto resume download and show custom notification? #2

aazam-nouri opened this issue Nov 28, 2018 · 5 comments

Comments

@aazam-nouri
Copy link

aazam-nouri commented Nov 28, 2018

I have found this library newly. It's really perfect but I have just two problems:

  1. when I go out of the download activity and come back, the download progress is paused and I have to start it again manually; How I can start it programmatically not manually when I come back to the activity?
  2. How I can show custom notification in the notification bar showing the current download progress and It's other info?
@huxq17
Copy link
Owner

huxq17 commented Nov 29, 2018

1.You can get downloadTask list at start of Activity,and resume download;
2.Pump only care download, you can start a notifycation by youself when received downloadInfo.

@aazam-nouri
Copy link
Author

Thanks for your response. In your sample; you are initiating and starting your whole download list in main activity before opening download list activity and your download list is providing from your download service, How can I initiate an start a download from a typical list item not list provided from the download service?

@huxq17
Copy link
Owner

huxq17 commented Dec 3, 2018

Download need url and filePath, and you can get them from downloadInfo,then you can start a download task.looks like this:

Pump.newRequest(downloadInfo.getUrl(), downloadInfo.getFilePath())
        //Optionally,Set whether to repeatedly download the downloaded file,default false.
        .forceReDownload(true)
        //Optionally,Set how many threads are used when downloading,default 3.
        .threadNum(3)
        .submit();

By the way, threadNum should be same as last download,otherwise the download will start all over again.

@aazam-nouri
Copy link
Author

Thanks, but my list is providing from the server side and I don't have any download info at first, I don't know how I can manage that.

@huxq17
Copy link
Owner

huxq17 commented Dec 22, 2018

Download server list first and build a download list by listening download progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants