Summary: Ctors | Methods | Inherited Methods | [Expand All]
public static final class

# NotificationOptions.Builder

extends Object

java.lang.Object
↳ | com.google.android.gms.cast.framework.media.NotificationOptions.Builder

## Class Overview

A builder to create an instance of `NotificationOptions`.

## Summary

Public Constructors
| NotificationOptions.Builder()

Public Methods
NotificationOptions | build() Builds and returns the `NotificationOptions` object.
NotificationOptions.Builder | setActions(List<String> actions, int[] compatActionIndices) Sets at most 5 actions to show in the notification, and the indices to the actions to show in the compat view.
NotificationOptions.Builder | setSkipStepMs(long notificationSkipStepMs) Sets the amount to jump if `ACTION_FORWARD` or `ACTION_REWIND` are included for the notification actions.
NotificationOptions.Builder | setTargetActivityClassName(String className) Sets the name of the `Activity` that will be launched when user taps on the content area of the notification.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public NotificationOptions.Builder ()

## Public Methods

#### public NotificationOptions build ()

Builds and returns the `NotificationOptions` object.

#### public NotificationOptions.Builder setActions (List<String> actions, int[] compatActionIndices)

Sets at most 5 actions to show in the notification, and the indices to the actions to show in the compat view. If both `actions` and `compatActionIndices` are `null`, the default values, `ACTION_TOGGLE_PLAYBACK` and `ACTION_STOP_CASTING` will be used.

##### Parameters

actions | The list of actions, defined in `MediaIntentReceiver`.
compatActionIndices | Indices of the actions in `actions` list, which will be shown in the compat view.

##### Throws

IllegalArgumentException | if `actions` and `compatActionIndices` are not either both `null` or `non-null`, or if the length of `compatActionIndices` is greater than the size of `actions`, or if any index in `compatActionIndices` is out of range.

##### See Also

- `MediaIntentReceiver`

#### public NotificationOptions.Builder setSkipStepMs (long notificationSkipStepMs)

Sets the amount to jump if `ACTION_FORWARD` or `ACTION_REWIND` are included for the notification actions. Any tap on those actions will result in moving the media position forward or backward by `notificationSkipStepMs` milliseconds. The default value is `SKIP_STEP_TEN_SECONDS_IN_MS`.

##### Parameters

notificationSkipStepMs | The amount of time to skip, in milliseconds.

##### Throws

IllegalArgumentException | if `notificationSkipStepMs` is not positive.

#### public NotificationOptions.Builder setTargetActivityClassName (String className)

Sets the name of the `Activity` that will be launched when user taps on the content area of the notification. If set to `null` then clicking on the content area will not launch any `Activity`. The default value is `null`.