Class SurfaceActionEvent

java.lang.Object
com.codename1.surfaces.SurfaceActionEvent

public class SurfaceActionEvent extends Object
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.
  • 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: the widget kind id or live activity type the tap came from
      • actionId: the app-defined action id of the tapped node
      • params: 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).