Hi'
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 ?
Hi'
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 ?
A download of...what?
If you are downloading via your own code (HttpUrlConnection
or HttpClient
), you know when the download is complete.
If you are using WebView
and want to know when the page is loaded, you can use a WebViewClient
to 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_VIEW
activity, then you will be "notified" by your activity starting up.