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

Bind DownloadManager to system broadcast #66

Closed maxi182Eman closed 6 years ago

maxi182Eman commented 6 years ago

Hi, I am needing to bind your DownloadManager to a system brodcast, so onRecive should be called when the download is complete, how can I achive this?

thanks

coolerfall commented 6 years ago

So in which case you want to send a brodcast? Just in your app?

maxi182Eman commented 6 years ago

Hi, Yes, when the dowload is complete, and the app is not in the foreground, onRecive method should be called and able to grab the downloadReferenceId. Thanks

coolerfall commented 6 years ago

Just use sendBroadcast in onComplete.

maxi182Eman commented 6 years ago

Hi, but does your Oncomplete method will be called when the download is complete while the app is close?

coolerfall commented 6 years ago

You should handle this in service by yourself. If you want to know how to keep app keeps alive in background, you should check Android's tutorial.