Function

hostAction

Creates a RemoteAction that triggers a named action on the host.

hostAction

Source set: Android
public fun hostAction(name: RemoteString): RemoteAction

Creates a RemoteAction that triggers a named action on the host.

Named actions are delivered to the onNamedAction callback of the Compose players. name may be a constant or a dynamic RemoteString; a dynamic name is resolved to its current value when the action runs.

Launcher widgets (RemoteViews) only dispatch id actions; use hostAction with an id there.

Parameters

name The name of the action.

hostAction

Source set: Android
public fun hostAction(name: RemoteString, value: RemoteFloat): RemoteAction

Creates a RemoteAction that triggers a named action on the host with a float value.

Parameters

name The name of the action.
value The float value to pass with the action, delivered to the host as a Float.

hostAction

Source set: Android
public fun hostAction(name: RemoteString, value: RemoteInt): RemoteAction

Creates a RemoteAction that triggers a named action on the host with an int value.

Parameters

name The name of the action.
value The int value to pass with the action, delivered to the host as an Int.

hostAction

Source set: Android
public fun hostAction(name: RemoteString, value: RemoteString): RemoteAction

Creates a RemoteAction that triggers a named action on the host with a string value.

Parameters

name The name of the action.
value The string value to pass with the action, delivered to the host as a String.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: