public interface

DownloadManager.Listener

 androidx.media3.exoplayer.offline.DownloadManager.Listener

Subclasses:

TestDownloadManagerListener

Overview

Listener for DownloadManager events.

Summary

Methods
public voidonDownloadChanged(DownloadManager downloadManager, Download download, java.lang.Exception finalException)

Called when the state of a download changes.

public voidonDownloadRemoved(DownloadManager downloadManager, Download download)

Called when a download is removed.

public voidonDownloadsPausedChanged(DownloadManager downloadManager, boolean downloadsPaused)

Called when downloads are (paused or resumed.

public voidonIdle(DownloadManager downloadManager)

Called when there is no active download left.

public voidonInitialized(DownloadManager downloadManager)

Called when all downloads have been restored.

public voidonRequirementsStateChanged(DownloadManager downloadManager, Requirements requirements, int notMetRequirements)

Called when the download requirements state changed.

public voidonWaitingForRequirementsChanged(DownloadManager downloadManager, boolean waitingForRequirements)

Called when there is a change in whether this manager has one or more downloads that are not progressing for the sole reason that the Requirements are not met.

Methods

public void onInitialized(DownloadManager downloadManager)

Called when all downloads have been restored.

Parameters:

downloadManager: The reporting instance.

public void onDownloadsPausedChanged(DownloadManager downloadManager, boolean downloadsPaused)

Called when downloads are (paused or resumed.

Parameters:

downloadManager: The reporting instance.
downloadsPaused: Whether downloads are currently paused.

public void onDownloadChanged(DownloadManager downloadManager, Download download, java.lang.Exception finalException)

Called when the state of a download changes.

Parameters:

downloadManager: The reporting instance.
download: The state of the download.
finalException: If the download is transitioning to Download.STATE_FAILED, this is the final exception that resulted in the failure.

public void onDownloadRemoved(DownloadManager downloadManager, Download download)

Called when a download is removed.

Parameters:

downloadManager: The reporting instance.
download: The last state of the download before it was removed.

public void onIdle(DownloadManager downloadManager)

Called when there is no active download left.

Parameters:

downloadManager: The reporting instance.

public void onRequirementsStateChanged(DownloadManager downloadManager, Requirements requirements, int notMetRequirements)

Called when the download requirements state changed.

Parameters:

downloadManager: The reporting instance.
requirements: Requirements needed to be met to start downloads.
notMetRequirements: that are not met, or 0.

public void onWaitingForRequirementsChanged(DownloadManager downloadManager, boolean waitingForRequirements)

Called when there is a change in whether this manager has one or more downloads that are not progressing for the sole reason that the Requirements are not met. See DownloadManager.isWaitingForRequirements() for more information.

Parameters:

downloadManager: The reporting instance.
waitingForRequirements: Whether this manager has one or more downloads that are not progressing for the sole reason that the Requirements are not met.