public class

ToastAction

extends Action
java.lang.Object
   ↳ com.urbanairship.actions.Action
     ↳ com.urbanairship.actions.ToastAction

Class Overview

An action that displays text in a toast.

Accepted situations: SITUATION_PUSH_OPENED, SITUATION_WEB_VIEW_INVOCATION, SITUATION_MANUAL_INVOCATION, SITUATION_AUTOMATION, SITUATION_BACKGROUND_NOTIFICATION_ACTION_BUTTON, and SITUATION_FOREGROUND_NOTIFICATION_ACTION_BUTTON.

Accepted argument value - A string with the toast text or a map with:

Result value: The arguments value.

Default Registration Names: toast_action

Summary

Constants
String DEFAULT_REGISTRY_NAME Default registry name
String LENGTH_KEY Key to define the Toast's length when providing the action's value as a map.
String TEXT_KEY Key to define the Toast's text when providing the action's value as a map.
[Expand]
Inherited Constants
From class com.urbanairship.actions.Action
Public Constructors
ToastAction()
Public Methods
boolean acceptsArguments(ActionArguments arguments)
Called before an action is performed to determine if the the action can accept the arguments.
ActionResult perform(ActionArguments arguments)
Performs the action.
boolean shouldRunOnMainThread()
Determines which thread runs the action.
[Expand]
Inherited Methods
From class com.urbanairship.actions.Action
From class java.lang.Object

Constants

public static final String DEFAULT_REGISTRY_NAME

Default registry name

Constant Value: "toast_action"

public static final String LENGTH_KEY

Key to define the Toast's length when providing the action's value as a map.

Constant Value: "length"

public static final String TEXT_KEY

Key to define the Toast's text when providing the action's value as a map.

Constant Value: "text"

Public Constructors

public ToastAction ()

Public Methods

public boolean acceptsArguments (ActionArguments arguments)

Called before an action is performed to determine if the the action can accept the arguments.

Parameters
arguments The action arguments.
Returns
  • true if the action can perform with the arguments, otherwise false.

public ActionResult perform (ActionArguments arguments)

Performs the action.

Parameters
arguments The action arguments.
Returns
  • The result of the action.

public boolean shouldRunOnMainThread ()

Determines which thread runs the action.

Returns
  • true if the action should be run on the main thread, or false if the action should run on a background thread.