public static class LocalNotification.Action

  1. Object
  2. LocalNotification.Action
A single action button attached to a local notification. An action may optionally include an inline text input (quick reply) by setting a placeholder and reply button text via LocalNotification#addInputAction(String, String, String, String).

Constructors

public Action(String id, String title)Creates an action.
public Action(String id, String title, String icon)Creates an action with an icon.

Methods

public String getId()Returns the action id.
public String getTitle()Returns the button label.
public String getIcon()Returns the drawable resource name used for the action icon on Android, or null.
public String getTextInputPlaceholder()Returns the placeholder text for the inline text input, or null when the action has no text input.
public String getTextInputButtonText()Returns the label of the reply button for the inline text input, or null when the action has no text input.
public boolean isTextInput()Returns true if this action has an inline text input (quick reply).

Inherited methods

Constructor details

Action

public Action(String id, String title)
Creates an action.

Parameters

id String
the action id reported back when the user taps the action
title String
the button label

Action

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

Creates an action with an icon.

The icon is a platform resource NAME, not a numeric id (Codename One has no numeric resource ids). On Android it is the name of a drawable bundled in the native/android folder (the build copies it into res/drawable), resolved at runtime by name; the file extension is optional and ignored. iOS notification action buttons do not display icons, so the value is ignored there.

Parameters

id String
the action id reported back when the user taps the action
title String
the button label
icon String
the drawable resource name for the action (Android only)

Method details

getId

public String getId()
Returns the action id.

Returns

the action id

getTitle

public String getTitle()
Returns the button label.

Returns

the title

getIcon

public String getIcon()
Returns the drawable resource name used for the action icon on Android, or null. See Action#Action(String, String, String) for how it is resolved.

Returns

the drawable resource name, or null

getTextInputPlaceholder

public String getTextInputPlaceholder()
Returns the placeholder text for the inline text input, or null when the action has no text input.

Returns

the text input placeholder, or null

getTextInputButtonText

public String getTextInputButtonText()
Returns the label of the reply button for the inline text input, or null when the action has no text input.

Returns

the reply button text, or null

isTextInput

public boolean isTextInput()
Returns true if this action has an inline text input (quick reply).

Returns

true if this is a text input action