# Class PushAction

java.lang.Object
com.codename1.push.PushAction

public class PushAction extends java.lang.Object
Encapsulates a push notification action. Available actions for a push notification are defined by the `PushActionsProvider#getPushActionCategories()` implementation.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PushAction(String title)`
  Creates a new push action
  `PushAction(String id, String title)`
  Creates a new push action
  `PushAction(String id, String title, String icon)`
  Creates a new push action
  `PushAction(String id, String title, String icon, String textInputPlaceholder, String textInputButtonText)`
  Creates a new push action

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getIcon()`
  The icon of the action.
  `String`
  `getId()`
  Gets the ID of the action.
  `String`
  `getTextInputButtonText()`
  The button label for the "reply" button on the text input field.
  `String`
  `getTextInputPlaceholder()`
  The placeholder text to use for text input on this action.
  `String`
  `getTitle()`
  The title of the action.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PushAction

    public PushAction(String id, String title, String icon)

    Creates a new push action

    ###### Parameters

    - `id`: @param id The ID of the action. This is the id that will be available in `PushContent#getActionId()` if the user selected this action on the push notification.

    - `title`: The title of the action. This is the button label in the push notification.

    - `icon`: Icon for the action. Not supported currently on most platforms.

  - ### PushAction

    public PushAction(String id, String title, String icon, String textInputPlaceholder, String textInputButtonText)

    Creates a new push action

    ###### Parameters

    - `id`: @param id The ID of the action. This is the id that will be available in `PushContent#getActionId()` if the user selected this action on the push notification.

    - `title`: The title of the action. This is the button label in the push notification.

    - `icon`: Icon for the action. Not supported currently on most platforms.

    - `textInputPlaceholder`: Placeholder text to use for the text input field.

    - `textInputButtonText`: Text to be used for the "reply" button in the text input field.

  - ### PushAction

    public PushAction(String id, String title)

    Creates a new push action

    ###### Parameters

    - `id`: @param id The ID of the action. This is the id that will be available in `PushContent#getActionId()` if the user selected this action on the push notification.

    - `title`: The title of the action. This is the button label in the push notification.

  - ### PushAction

    public PushAction(String title)

    Creates a new push action

    ###### Parameters

    - `title`: The title and id of the action. This is the button label in the push notification.

- ## Method Details

  - ### getId

    public String getId()

    Gets the ID of the action. This is the value that will be made available inside the `PushCallback#push(java.lang.String)` method via `PushContent#getActionId()` if the user selects this action in a push notification.

    ###### Returns

    the id The ID of the action.

    ###### See also

    - PushContent#getActionId()

  - ### getTitle

    public String getTitle()

    The title of the action. This will be the label for the action's button in the push notification.

    ###### Returns

    the title The title of the action.

  - ### getIcon

    public String getIcon()

    The icon of the action. Not supported yet on most platforms.

    ###### Returns

    the icon The icon for the action.

  - ### getTextInputPlaceholder

    public String getTextInputPlaceholder()

    The placeholder text to use for text input on this action. Either `#textInputButtonText` or `#textInputPlaceholder` must be non-null for the action to include a text input.

    ###### Returns

    the textInputPlaceholder

  - ### getTextInputButtonText

    public String getTextInputButtonText()

    The button label for the "reply" button on the text input field. Either `#textInputButtonText` or `#textInputPlaceholder` must be non-null for the action to include a text input.

    ###### Returns

    the textInputButtonText