public abstract class AbstractDownloadCallback<T> extends Object implements DownloadCallback<T>
| Constructor and Description |
|---|
AbstractDownloadCallback() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelled()
Calls when the operation has been cancelled.
|
void |
done(T result)
Calls when the operation completed successfully.
|
void |
failed(Throwable e)
Calls when the operation failed.
|
void |
retry(Throwable e,
int current,
int max)
Calls when download failed and the downloader will retry the download task.
|
void |
updateProgress(long done,
long total)
Calls when the progress of the download operation updated.
|
public void done(T result)
Callbackpublic void failed(Throwable e)
Callbackpublic void cancelled()
Callbackpublic void updateProgress(long done,
long total)
DownloadCallbackupdateProgress in interface DownloadCallback<T>done - the bytes downloadedtotal - the total bytes, -1 if unknownpublic void retry(Throwable e, int current, int max)
DownloadCallback
Notes: Callback.failed(Throwable) will be called only when the download failed and the downloader won't retry
it any more. If the downloader will retry the download task, this method will be called, instead of
Callback.failed(Throwable).
retry in interface DownloadCallback<T>e - the cause of download failurecurrent - the retry count (1 for the first, max-1 for the latest)max - the max number of triesCopyright © 2016. All rights reserved.