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.
|
Loader.LoadErrorAction |
onLoadError(T loadable,
long elapsedRealtimeMs,
long loadDurationMs,
java.io.IOException error,
int errorCount)
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 in milliseconds of the load since Loader.startLoading(T, com.google.android.exoplayer2.upstream.Loader.Callback<T>, int)
was called.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 in milliseconds of the load since Loader.startLoading(T, com.google.android.exoplayer2.upstream.Loader.Callback<T>, int)
was called up to the point at which it was canceled.released - True if the load was canceled because the Loader was released. False
otherwise.Loader.LoadErrorAction onLoadError(T loadable, long elapsedRealtimeMs, long loadDurationMs, java.io.IOException error, int errorCount)
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 in milliseconds of the load since Loader.startLoading(T, com.google.android.exoplayer2.upstream.Loader.Callback<T>, int)
was called up to the point at which the error occurred.error - The load error.errorCount - The number of errors this load has encountered, including this one.Loader.RETRY, Loader.RETRY_RESET_ERROR_COUNT, Loader.DONT_RETRY, Loader.DONT_RETRY_FATAL or a retry action created by Loader.createRetryAction(boolean, long).