Is there a piece of code I could write to be notified when a download finishes in android, and be able to execute some custom actions on this event ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A download of…what?
If you are downloading via your own code (
HttpUrlConnectionorHttpClient), you know when the download is complete.If you are using
WebViewand want to know when the page is loaded, you can use aWebViewClientto be notified of that event.If the user is using the Browser application or a third-party browser, you cannot “be notified when a download finishes” in general. If you are set up to be a handler of that MIME type, and if the user chooses to open the file in your
ACTION_VIEWactivity, then you will be “notified” by your activity starting up.