Class LocalNotification.Action

java.lang.Object
com.codename1.notifications.LocalNotification.Action
Enclosing class:
LocalNotification

public static class LocalNotification.Action extends Object
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).
  • Constructor Details

    • Action

      public Action(String id, String title)

      Creates an action.

      Parameters
      • id: the action id reported back when the user taps the action

      • title: 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: the action id reported back when the user taps the action

      • title: the button label

      • icon: 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