Back to Exoplayer

NotificationUtil (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/util/NotificationUtil.html

latest8.9 KB
Original Source

Package com.google.android.exoplayer2.util

Class NotificationUtil


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classNotificationUtilextends[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.

Utility methods for displaying Notifications.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static interface | NotificationUtil.Importance | Deprecated.

Notification channel importance levels. |

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static int | IMPORTANCE_DEFAULT | Deprecated. | | static int | IMPORTANCE_HIGH | Deprecated. | | static int | IMPORTANCE_LOW | Deprecated. | | static int | IMPORTANCE_MIN | Deprecated. | | static int | IMPORTANCE_NONE | Deprecated. | | static int | IMPORTANCE_UNSPECIFIED | Deprecated. |

Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static void | createNotificationChannel​(Context context, String id, int nameResourceId, int descriptionResourceId, @com.google.android.exoplayer2.util.NotificationUtil.Importance int importance) | Deprecated.

Creates a notification channel that notifications can be posted to. | | static void | setNotification​(Context context, int id, Notification notification) | Deprecated.

Post a notification to be shown in the status bar. |

- 

Methods inherited from class java.lang.Object

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

Field Detail

- 

IMPORTANCE_UNSPECIFIED

public static final int IMPORTANCE_UNSPECIFIED

Deprecated. See Also:NotificationManager.IMPORTANCE_UNSPECIFIED, Constant Field Values

- 

IMPORTANCE_NONE

public static final int IMPORTANCE_NONE

Deprecated. See Also:NotificationManager.IMPORTANCE_NONE, Constant Field Values

- 

IMPORTANCE_MIN

public static final int IMPORTANCE_MIN

Deprecated. See Also:NotificationManager.IMPORTANCE_MIN, Constant Field Values

- 

IMPORTANCE_LOW

public static final int IMPORTANCE_LOW

Deprecated. See Also:NotificationManager.IMPORTANCE_LOW, Constant Field Values

- 

IMPORTANCE_DEFAULT

public static final int IMPORTANCE_DEFAULT

Deprecated. See Also:NotificationManager.IMPORTANCE_DEFAULT, Constant Field Values

- 

IMPORTANCE_HIGH

public static final int IMPORTANCE_HIGH

Deprecated. See Also:NotificationManager.IMPORTANCE_HIGH, Constant Field Values

Method Detail

- 

createNotificationChannel

public static void createNotificationChannel​([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")id,
                                             @StringRes
                                             int nameResourceId,
                                             @StringRes
                                             int descriptionResourceId,
                                             @com.google.android.exoplayer2.util.NotificationUtil.Importance int importance)

Deprecated.

Creates a notification channel that notifications can be posted to. See NotificationChannel and NotificationManager.createNotificationChannel(NotificationChannel) for details. Parameters:context - A Context.id - The id of the channel. Must be unique per package. The value may be truncated if it's too long.nameResourceId - A string resource identifier for the user visible name of the channel. The recommended maximum length is 40 characters. The string may be truncated if it's too long. You can rename the channel when the system locale changes by listening for the Intent.ACTION_LOCALE_CHANGED broadcast.descriptionResourceId - A string resource identifier for the user visible description of the channel, or 0 if no description is provided. The recommended maximum length is 300 characters. The value may be truncated if it is too long. You can change the description of the channel when the system locale changes by listening for the Intent.ACTION_LOCALE_CHANGED broadcast.importance - The importance of the channel. This controls how interruptive notifications posted to this channel are. One of IMPORTANCE_UNSPECIFIED, IMPORTANCE_NONE, IMPORTANCE_MIN, IMPORTANCE_LOW, IMPORTANCE_DEFAULT and IMPORTANCE_HIGH.

- 

setNotification

public static void setNotification​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,
                                   int id,
                                   @Nullable[Notification](https://developer.android.com/reference/android/app/Notification.html "class or interface in android.app")notification)

Deprecated.

Post a notification to be shown in the status bar. If a notification with the same id has already been posted by your application and has not yet been canceled, it will be replaced by the updated information. If notification is null then any notification previously shown with the specified id will be cancelled. Parameters:context - A Context.id - The notification id.notification - The Notification to post, or null to cancel a previously shown notification.