Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public static class

Notification.Action

extends Object
implements Parcelable
java.lang.Object
   ↳ android.app.Notification.Action

Class Overview

Structure to encapsulate a named action that can be shown as part of this notification. It must include an icon, a label, and a PendingIntent to be fired when the action is selected by the user.

Apps should use addAction(int, CharSequence, PendingIntent) or addAction(Notification.Action) to attach actions.

Summary

Nested Classes
class Notification.Action.Builder Builder class for Notification.Action objects. 
interface Notification.Action.Extender Extender interface for use with extend(Notification.Action.Extender)
class Notification.Action.WearableExtender Wearable extender for notification actions. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator < Notification.Action > CREATOR
public PendingIntent actionIntent Intent to send when the user invokes this action.
public int icon Small icon representing the action.
public CharSequence title Title of the action.
Public Constructors
Notification.Action (int icon, CharSequence title, PendingIntent intent)
Public Methods
Notification.Action clone ()
Creates and returns a copy of this Object .
int describeContents ()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Bundle getExtras ()
Get additional metadata carried around with this Action.
RemoteInput[] getRemoteInputs ()
Get the list of inputs to be collected from the user when this action is sent.
void writeToParcel ( Parcel out, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator < Notification.Action > CREATOR

public PendingIntent actionIntent

Intent to send when the user invokes this action. May be null, in which case the action may be rendered in a disabled presentation by the system UI.

public int icon

Small icon representing the action.

public CharSequence title

Title of the action.

Public Constructors

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

Public Methods

public Notification.Action clone ()

Creates and returns a copy of this Object . The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.

Returns
  • a copy of this object.

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public Bundle getExtras ()

Get additional metadata carried around with this Action.

public RemoteInput[] getRemoteInputs ()

Get the list of inputs to be collected from the user when this action is sent. May return null if no remote inputs were added.

public void writeToParcel ( Parcel out, int flags)

Flatten this object in to a Parcel.

Parameters
out The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE .