public interface TransferListener
A transfer usually progresses through multiple steps:
onTransferInitializing(DataSource, DataSpec, boolean) is called before the initialization
starts.
onTransferStart(DataSource, DataSpec, boolean) is called. Note that this only happens if
the initialization was successful.
onBytesTransferred(DataSource, DataSpec, boolean, int) is
called frequently during the transfer to indicate progress.
onTransferEnd(DataSource,
DataSpec, boolean) is called. Note that each onTransferStart(DataSource, DataSpec,
boolean) will have exactly one corresponding call to onTransferEnd(DataSource,
DataSpec, boolean).
| Modifier and Type | Method and Description |
|---|---|
void |
onBytesTransferred(DataSource source,
DataSpec dataSpec,
boolean isNetwork,
int bytesTransferred)
Called incrementally during a transfer.
|
void |
onTransferEnd(DataSource source,
DataSpec dataSpec,
boolean isNetwork)
Called when a transfer ends.
|
void |
onTransferInitializing(DataSource source,
DataSpec dataSpec,
boolean isNetwork)
Called when a transfer is being initialized.
|
void |
onTransferStart(DataSource source,
DataSpec dataSpec,
boolean isNetwork)
Called when a transfer starts.
|
void onTransferInitializing(DataSource source, DataSpec dataSpec, boolean isNetwork)
source - The source performing the transfer.dataSpec - Describes the data for which the transfer is initialized.isNetwork - Whether the data is transferred through a network.void onTransferStart(DataSource source, DataSpec dataSpec, boolean isNetwork)
source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.void onBytesTransferred(DataSource source, DataSpec dataSpec, boolean isNetwork, int bytesTransferred)
source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.bytesTransferred - The number of bytes transferred since the previous call to this methodvoid onTransferEnd(DataSource source, DataSpec dataSpec, boolean isNetwork)
source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.