public static interface Loader.Callback<T extends Loader.Loadable>
Loader
events.Modifier and Type | Method and Description |
---|---|
void |
onLoadCanceled(T loadable,
long elapsedRealtimeMs,
long loadDurationMs,
boolean released)
Called when a load has been canceled.
|
void |
onLoadCompleted(T loadable,
long elapsedRealtimeMs,
long loadDurationMs)
Called when a load has completed.
|
int |
onLoadError(T loadable,
long elapsedRealtimeMs,
long loadDurationMs,
IOException error)
Called when a load encounters an error.
|
void onLoadCompleted(T loadable, long elapsedRealtimeMs, long loadDurationMs)
Note: There is guaranteed to be a memory barrier between Loader.Loadable.load()
exiting and
this callback being called.
loadable
- The loadable whose load has completed.elapsedRealtimeMs
- SystemClock.elapsedRealtime()
when the load ended.loadDurationMs
- The duration of the load.void onLoadCanceled(T loadable, long elapsedRealtimeMs, long loadDurationMs, boolean released)
Note: If the Loader
has not been released then there is guaranteed to be a memory
barrier between Loader.Loadable.load()
exiting and this callback being called. If the
Loader
has been released then this callback may be called before
Loader.Loadable.load()
exits.
loadable
- The loadable whose load has been canceled.elapsedRealtimeMs
- SystemClock.elapsedRealtime()
when the load was canceled.loadDurationMs
- The duration of the load up to the point at which it was canceled.released
- True if the load was canceled because the Loader
was released. False
otherwise.int onLoadError(T loadable, long elapsedRealtimeMs, long loadDurationMs, IOException error)
Note: There is guaranteed to be a memory barrier between Loader.Loadable.load()
exiting and
this callback being called.
loadable
- The loadable whose load has encountered an error.elapsedRealtimeMs
- SystemClock.elapsedRealtime()
when the error occurred.loadDurationMs
- The duration of the load up to the point at which the error occurred.error
- The load error.Loader.RETRY
,
Loader.RETRY_RESET_ERROR_COUNT
, Loader.DONT_RETRY
and
Loader.DONT_RETRY_FATAL
.