to top
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) to create and attach actions.

Summary

[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.
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

Added in API level 19

public PendingIntent actionIntent

Added in API level 19

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

Added in API level 19

Small icon representing the action.

public CharSequence title

Added in API level 19

Title of the action.

Public Constructors

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

Added in API level 19

Public Methods

public Notification.Action clone ()

Added in API level 19

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 ()

Added in API level 19

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 void writeToParcel (Parcel out, int flags)

Added in API level 19

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.