public interface MediaHttpDownloaderProgressListener
Sample usage:
public static class MyDownloadProgressListener implements MediaHttpDownloaderProgressListener { public void progressChanged(MediaHttpDownloader downloader) throws IOException { switch (downloader.getDownloadState()) { case MEDIA_IN_PROGRESS: System.out.println("Download in progress"); System.out.println("Download percentage: " + downloader.getProgress()); break; case MEDIA_COMPLETE: System.out.println("Download Completed!"); break; } } }
Modifier and Type | Method and Description |
---|---|
void |
progressChanged(MediaHttpDownloader downloader)
Called to notify that progress has been changed.
|
void progressChanged(MediaHttpDownloader downloader) throws IOException
This method is called multiple times depending on how many chunks are downloaded. Once the download completes it is called one final time.
The download state can be queried by calling MediaHttpDownloader.getDownloadState()
and the progress by calling MediaHttpDownloader.getProgress()
.
downloader
- Media HTTP downloaderIOException
Copyright © 2010–2021 Google. All rights reserved.