Back to Exoplayer

DownloadNotificationHelper (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ui/DownloadNotificationHelper.html

latest9.0 KB
Original Source

Package com.google.android.exoplayer2.ui

Class DownloadNotificationHelper


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDownloadNotificationHelperextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Helper for creating download notifications.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | DownloadNotificationHelper​(Context context, String channelId) | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | Notification | buildDownloadCompletedNotification​(Context context, int smallIcon, PendingIntent contentIntent, String message) | Deprecated.

Returns a notification for a completed download. | | Notification | buildDownloadFailedNotification​(Context context, int smallIcon, PendingIntent contentIntent, String message) | Deprecated.

Returns a notification for a failed download. | | Notification | buildProgressNotification​(Context context, int smallIcon, PendingIntent contentIntent, String message, List<Download> downloads) | Deprecated. Use buildProgressNotification(Context, int, PendingIntent, String, List, int).

| | Notification | buildProgressNotification​(Context context, int smallIcon, PendingIntent contentIntent, String message, List<Download> downloads, @com.google.android.exoplayer2.scheduler.Requirements.RequirementFlags int notMetRequirements) | Deprecated.

Returns a progress notification for the given downloads. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

DownloadNotificationHelper

public DownloadNotificationHelper​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")channelId)

Deprecated. Parameters:context - A context.channelId - The id of the notification channel to use.

Method Detail

- 

buildProgressNotification

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public[Notification](https://developer.android.com/reference/android/app/Notification.html "class or interface in android.app")buildProgressNotification​([Context](https://developer.android.com/reference/android/content/Context.html?is-external=true "class or interface in android.content")context,
                                              @DrawableRes
                                              int smallIcon,
                                              @Nullable[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html "class or interface in android.app")contentIntent,
                                              @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Download](../offline/Download.html "class in com.google.android.exoplayer2.offline")> downloads)

Deprecated. Use buildProgressNotification(Context, int, PendingIntent, String, List, int).

- 

buildProgressNotification

public[Notification](https://developer.android.com/reference/android/app/Notification.html "class or interface in android.app")buildProgressNotification​([Context](https://developer.android.com/reference/android/content/Context.html?is-external=true "class or interface in android.content")context,
                                              @DrawableRes
                                              int smallIcon,
                                              @Nullable[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html "class or interface in android.app")contentIntent,
                                              @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Download](../offline/Download.html "class in com.google.android.exoplayer2.offline")> downloads,[@RequirementFlags](../scheduler/Requirements.RequirementFlags.html "annotation in com.google.android.exoplayer2.scheduler")@com.google.android.exoplayer2.scheduler.Requirements.RequirementFlags int notMetRequirements)

Deprecated.

Returns a progress notification for the given downloads. Parameters:context - A context.smallIcon - A small icon for the notification.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.downloads - The downloads.notMetRequirements - Any requirements for downloads that are not currently met.Returns:The notification.

- 

buildDownloadCompletedNotification

public[Notification](https://developer.android.com/reference/android/app/Notification.html "class or interface in android.app")buildDownloadCompletedNotification​([Context](https://developer.android.com/reference/android/content/Context.html?is-external=true "class or interface in android.content")context,
                                                       @DrawableRes
                                                       int smallIcon,
                                                       @Nullable[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html "class or interface in android.app")contentIntent,
                                                       @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message)

Deprecated.

Returns a notification for a completed download. Parameters:context - A context.smallIcon - A small icon for the notifications.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.Returns:The notification.

- 

buildDownloadFailedNotification

public[Notification](https://developer.android.com/reference/android/app/Notification.html "class or interface in android.app")buildDownloadFailedNotification​([Context](https://developer.android.com/reference/android/content/Context.html?is-external=true "class or interface in android.content")context,
                                                    @DrawableRes
                                                    int smallIcon,
                                                    @Nullable[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html "class or interface in android.app")contentIntent,
                                                    @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message)

Deprecated.

Returns a notification for a failed download. Parameters:context - A context.smallIcon - A small icon for the notifications.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.Returns:The notification.