coolerfall / Android-HttpDownloadManager

An useful and effective http/https download manager for Android, support breakpoint downloading.
https://ahdm.coolerfall.com
Apache License 2.0
206 stars 43 forks source link

Download not cancelled #63

Closed mraj0045 closed 6 years ago

mraj0045 commented 6 years ago

The download is not canceling when used inside FirebaseJobDispatcher. When canceling the job manually, the download still continues even after the job canceled.

And also tried to cancel the download from the code manually. But cancel download only works if the same "object" created for downloading the file is used for canceling. If I create a new DownloadManager Object and cancel the download, it should cancel.

coolerfall commented 6 years ago

You should create a global DownloadManager, and then you can cancel task.

mraj0045 commented 6 years ago

What if I close the app and open again while downloading? will the global DownloadManager work?

coolerfall commented 6 years ago

What do you mean close the app? If your app exit totally, the download manager will stop and no tasks.

mraj0045 commented 6 years ago

while downloading some file I'm closing the app. The download happens in the background. if I open the app again and try to cancel the download, will it work if using global DownloadManager?

coolerfall commented 6 years ago

Do you mean you have a service in background? If so, the gloabl DownloadManager will work.

mraj0045 commented 6 years ago

yes

coolerfall commented 6 years ago

You should create an instance of DownloadManager in your service, so that you can control the downloading.

mraj0045 commented 6 years ago

What I want to do is that there is a separate page for Managing downloads. There I can pause, resume, cancel the download. But download happens in a separate service. Even if create an instance Of DownloadManager in service, how will I able to perform (pause, resume, cancel) from the activity.

coolerfall commented 6 years ago

I think you should check communication between activity and service on google.