public class SurfaceActionEvent

  1. Object
  2. SurfaceActionEvent
A user interaction with an external surface: the user tapped a node that carries an action id. Because surfaces render outside the (possibly dead) app process, the tap first opens or foregrounds the app and the framework then delivers this event to the handler registered with Surfaces.setActionHandler(...) on the EDT. Events that arrive before a handler is registered (typically because the tap launched the app) are queued and flagged as cold start.

Constructors

public SurfaceActionEvent(String source, String actionId, Map<String, Object> params)Creates an action event.

Methods

public String getSource()Returns the widget kind id or live activity type the tap came from.
public String getActionId()Returns the app-defined action id of the tapped node.
public Map<String, Object> getParams()Returns the action parameters, never null.
public boolean isColdStart()Returns true when this event launched the app (it arrived before an action handler was registered and was queued until registration).

Inherited methods

Constructor details

SurfaceActionEvent

public SurfaceActionEvent(String source, String actionId, Map<String, Object> params)
Creates an action event. Framework/port use; apps only consume these.

Parameters

source String
the widget kind id or live activity type the tap came from
actionId String
the app-defined action id of the tapped node
params Map<String, Object>
the action parameters, may be null

Method details

getSource

public String getSource()
Returns the widget kind id or live activity type the tap came from.

getActionId

public String getActionId()
Returns the app-defined action id of the tapped node.

getParams

public Map<String, Object> getParams()
Returns the action parameters, never null.

isColdStart

public boolean isColdStart()
Returns true when this event launched the app (it arrived before an action handler was registered and was queued until registration).