Skip to content

Most visited

Recently visited

navigation
Added in API level 20

Notification.Action.Builder

public static final class Notification.Action.Builder
extends Object

java.lang.Object
   ↳ android.app.Notification.Action.Builder


Builder class for Notification.Action objects.

Summary

Public constructors

Notification.Action.Builder(int icon, CharSequence title, PendingIntent intent)

Construct a new builder for Notification.Action object.

Notification.Action.Builder(Icon icon, CharSequence title, PendingIntent intent)

Construct a new builder for Notification.Action object.

Notification.Action.Builder(Notification.Action action)

Construct a new builder for Notification.Action object using the fields from an Notification.Action.

Public methods

Notification.Action.Builder addExtras(Bundle extras)

Merge additional metadata into this builder.

Notification.Action.Builder addRemoteInput(RemoteInput remoteInput)

Add an input to be collected from the user when this action is sent.

Notification.Action build()

Combine all of the options that have been set and return a new Notification.Action object.

Notification.Action.Builder extend(Notification.Action.Extender extender)

Apply an extender to this action builder.

Bundle getExtras()

Get the metadata Bundle used by this Builder.

Inherited methods

From class java.lang.Object

Public constructors

Notification.Action.Builder

Added in API level 20
Notification.Action.Builder (int icon, 
                CharSequence title, 
                PendingIntent intent)

Construct a new builder for Notification.Action object.

Parameters
icon int: icon to show for this action
title CharSequence: the title of the action
intent PendingIntent: the PendingIntent to fire when users trigger this action

Notification.Action.Builder

Added in API level 23
Notification.Action.Builder (Icon icon, 
                CharSequence title, 
                PendingIntent intent)

Construct a new builder for Notification.Action object.

Parameters
icon Icon: icon to show for this action
title CharSequence: the title of the action
intent PendingIntent: the PendingIntent to fire when users trigger this action

Notification.Action.Builder

Added in API level 20
Notification.Action.Builder (Notification.Action action)

Construct a new builder for Notification.Action object using the fields from an Notification.Action.

Parameters
action Notification.Action: the action to read fields from.

Public methods

addExtras

Added in API level 20
Notification.Action.Builder addExtras (Bundle extras)

Merge additional metadata into this builder.

Values within the Bundle will replace existing extras values in this Builder.

Parameters
extras Bundle
Returns
Notification.Action.Builder

See also:

addRemoteInput

Added in API level 20
Notification.Action.Builder addRemoteInput (RemoteInput remoteInput)

Add an input to be collected from the user when this action is sent. Response values can be retrieved from the fired intent by using the getResultsFromIntent(Intent) function.

Parameters
remoteInput RemoteInput: a RemoteInput to add to the action
Returns
Notification.Action.Builder this object for method chaining

build

Added in API level 20
Notification.Action build ()

Combine all of the options that have been set and return a new Notification.Action object.

Returns
Notification.Action the built action

extend

Added in API level 20
Notification.Action.Builder extend (Notification.Action.Extender extender)

Apply an extender to this action builder. Extenders may be used to add metadata or change options on this builder.

Parameters
extender Notification.Action.Extender
Returns
Notification.Action.Builder

getExtras

Added in API level 20
Bundle getExtras ()

Get the metadata Bundle used by this Builder.

The returned Bundle is shared with this Builder.

Returns
Bundle
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.