Once you have an action, you add it to your application using the Actions
widget, which takes a map of Intent types to Actions:

Invoking Actions

The actions system has several ways to invoke actions.  By far the most common
way is through the use of a Shortcuts widget covered in the previous section,
but there are other ways to interrogate the actions subsystem and invoke an
action. It’s possible to invoke actions that are not bound to keys.

For instance, to find an action associated with an intent, you can use:

To invoke the action (if it exists), call:

Combine that into one call with the following:

Sometimes you want to invoke an action as a result of pressing a button or
another control. Do this with the Actions.handler function, which creates a
handler closure if the intent has a mapping to an enabled action, and returns
null if it doesn’t, so that the button is disabled if there is no matching
enabled action in the context: