docs/doc/reference/com/google/android/exoplayer2/ui/PlayerNotificationManager.Builder.html
Package com.google.android.exoplayer2.ui
Enclosing class:PlayerNotificationManager
public static classPlayerNotificationManager.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
A builder for PlayerNotificationManager instances.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| protected int | channelDescriptionResourceId | |
| protected String | channelId | |
| protected int | channelImportance | |
| protected int | channelNameResourceId | |
| protected Context | context | |
| protected PlayerNotificationManager.CustomActionReceiver | customActionReceiver | |
| protected int | fastForwardActionIconResourceId | |
| protected String | groupKey | |
| protected PlayerNotificationManager.MediaDescriptionAdapter | mediaDescriptionAdapter | |
| protected int | nextActionIconResourceId | |
| protected int | notificationId | |
| protected PlayerNotificationManager.NotificationListener | notificationListener | |
| protected int | pauseActionIconResourceId | |
| protected int | playActionIconResourceId | |
| protected int | previousActionIconResourceId | |
| protected int | rewindActionIconResourceId | |
| protected int | smallIconResourceId | |
| protected int | stopActionIconResourceId | |
Constructors | Constructor | Description |
| --- | --- |
| Builder(Context context, int notificationId, String channelId) |
Creates an instance.
|
| Builder(Context context, int notificationId, String channelId, PlayerNotificationManager.MediaDescriptionAdapter mediaDescriptionAdapter) |
Deprecated.
Use Builder(Context, int, String) instead, then call setMediaDescriptionAdapter(MediaDescriptionAdapter).
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| PlayerNotificationManager | build() |
Builds the PlayerNotificationManager.
|
| PlayerNotificationManager.Builder | setChannelDescriptionResourceId(int channelDescriptionResourceId) |
The description of the channel.
|
| PlayerNotificationManager.Builder | setChannelImportance(@com.google.android.exoplayer2.util.NotificationUtil.Importance int channelImportance) |
The importance of the channel.
|
| PlayerNotificationManager.Builder | setChannelNameResourceId(int channelNameResourceId) |
The name of the channel.
|
| PlayerNotificationManager.Builder | setCustomActionReceiver(PlayerNotificationManager.CustomActionReceiver customActionReceiver) |
The PlayerNotificationManager.CustomActionReceiver to be used.
|
| PlayerNotificationManager.Builder | setFastForwardActionIconResourceId(int fastForwardActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_FAST_FORWARD.
|
| PlayerNotificationManager.Builder | setGroup(String groupKey) |
The key of the group the media notification should belong to.
|
| PlayerNotificationManager.Builder | setMediaDescriptionAdapter(PlayerNotificationManager.MediaDescriptionAdapter mediaDescriptionAdapter) |
The PlayerNotificationManager.MediaDescriptionAdapter to be queried for the notification contents.
|
| PlayerNotificationManager.Builder | setNextActionIconResourceId(int nextActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_NEXT.
|
| PlayerNotificationManager.Builder | setNotificationListener(PlayerNotificationManager.NotificationListener notificationListener) |
The PlayerNotificationManager.NotificationListener to be used.
|
| PlayerNotificationManager.Builder | setPauseActionIconResourceId(int pauseActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_PAUSE.
|
| PlayerNotificationManager.Builder | setPlayActionIconResourceId(int playActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_PLAY.
|
| PlayerNotificationManager.Builder | setPreviousActionIconResourceId(int previousActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_PREVIOUS.
|
| PlayerNotificationManager.Builder | setRewindActionIconResourceId(int rewindActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_REWIND.
|
| PlayerNotificationManager.Builder | setSmallIconResourceId(int smallIconResourceId) |
The resource id of the small icon of the notification shown in the status bar.
|
| PlayerNotificationManager.Builder | setStopActionIconResourceId(int stopActionIconResourceId) |
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_STOP.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
protected final[Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context
-
protected final int notificationId
-
protected final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")channelId
-
@Nullable
protected[PlayerNotificationManager.NotificationListener](PlayerNotificationManager.NotificationListener.html "interface in com.google.android.exoplayer2.ui")notificationListener
-
@Nullable
protected[PlayerNotificationManager.CustomActionReceiver](PlayerNotificationManager.CustomActionReceiver.html "interface in com.google.android.exoplayer2.ui")customActionReceiver
-
protected[PlayerNotificationManager.MediaDescriptionAdapter](PlayerNotificationManager.MediaDescriptionAdapter.html "interface in com.google.android.exoplayer2.ui")mediaDescriptionAdapter
-
protected int channelNameResourceId
-
protected int channelDescriptionResourceId
-
protected int channelImportance
-
protected int smallIconResourceId
-
protected int rewindActionIconResourceId
-
protected int playActionIconResourceId
-
protected int pauseActionIconResourceId
-
protected int stopActionIconResourceId
-
protected int fastForwardActionIconResourceId
-
protected int previousActionIconResourceId
-
protected int nextActionIconResourceId
-
@Nullable
protected[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")groupKey
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public Builder([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,
int notificationId,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")channelId,[PlayerNotificationManager.MediaDescriptionAdapter](PlayerNotificationManager.MediaDescriptionAdapter.html "interface in com.google.android.exoplayer2.ui")mediaDescriptionAdapter)
Deprecated.
Use Builder(Context, int, String) instead, then call setMediaDescriptionAdapter(MediaDescriptionAdapter).
-
public Builder([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,
@IntRange(from=1L)
int notificationId,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")channelId)
Creates an instance.
Parameters:context - The Context.notificationId - The id of the notification to be posted. Must be greater than 0.channelId - The id of the notification channel of an existing notification channel or of the channel that should be automatically created. In the latter case, setChannelNameResourceId(int) needs to be called as well.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setChannelNameResourceId(int channelNameResourceId)
The name of the channel. If set to a value other than 0, the channel is automatically created when build() is called. If the application has already created the notification channel, then this method should not be called.
The default is 0.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setChannelDescriptionResourceId(int channelDescriptionResourceId)
The description of the channel. Ignored if setChannelNameResourceId(int) is not called with a value other than 0. If the application has already created the notification channel, then this method should not be called.
The default is 0.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setChannelImportance(@com.google.android.exoplayer2.util.NotificationUtil.Importance int channelImportance)
The importance of the channel. Ignored if setChannelNameResourceId(int) is not called with a value other than 0. If the application has already created the notification channel, then this method should not be called.
The default is NotificationUtil.IMPORTANCE_LOW.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setNotificationListener([PlayerNotificationManager.NotificationListener](PlayerNotificationManager.NotificationListener.html "interface in com.google.android.exoplayer2.ui")notificationListener)
The PlayerNotificationManager.NotificationListener to be used.
The default is null.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setCustomActionReceiver([PlayerNotificationManager.CustomActionReceiver](PlayerNotificationManager.CustomActionReceiver.html "interface in com.google.android.exoplayer2.ui")customActionReceiver)
The PlayerNotificationManager.CustomActionReceiver to be used.
The default is null.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setSmallIconResourceId(int smallIconResourceId)
The resource id of the small icon of the notification shown in the status bar. See NotificationCompat.Builder.setSmallIcon(int).
The default is R.drawable#exo_notification_small_icon.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setPlayActionIconResourceId(int playActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_PLAY.
The default is R.drawable#exo_notification_play.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setPauseActionIconResourceId(int pauseActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_PAUSE.
The default is R.drawable#exo_notification_pause.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setStopActionIconResourceId(int stopActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_STOP.
The default is R.drawable#exo_notification_stop.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setRewindActionIconResourceId(int rewindActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_REWIND.
The default is R.drawable#exo_notification_rewind.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setFastForwardActionIconResourceId(int fastForwardActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_FAST_FORWARD.
The default is R.drawable#exo_notification_fastforward.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setPreviousActionIconResourceId(int previousActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_PREVIOUS.
The default is R.drawable#exo_notification_previous.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setNextActionIconResourceId(int nextActionIconResourceId)
The resource id of the drawable to be used as the icon of action PlayerNotificationManager.ACTION_NEXT.
The default is R.drawable#exo_notification_next.
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setGroup([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")groupKey)
The key of the group the media notification should belong to.
The default is null
Returns:This builder.
-
public[PlayerNotificationManager.Builder](PlayerNotificationManager.Builder.html "class in com.google.android.exoplayer2.ui")setMediaDescriptionAdapter([PlayerNotificationManager.MediaDescriptionAdapter](PlayerNotificationManager.MediaDescriptionAdapter.html "interface in com.google.android.exoplayer2.ui")mediaDescriptionAdapter)
The PlayerNotificationManager.MediaDescriptionAdapter to be queried for the notification contents.
The default is DefaultMediaDescriptionAdapter with no PendingIntent
Returns:This builder.
-
public[PlayerNotificationManager](PlayerNotificationManager.html "class in com.google.android.exoplayer2.ui")build()
Builds the PlayerNotificationManager.