# androidx.glance.appwidget.action

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback` | A callback executed in response to the user action, before the content is updated. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallbackBroadcastReceiver` | Responds to broadcasts from `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/RunCallbackAction` clicks by executing the associated action. |
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionTrampolineActivity` | Trampoline activity for handling click interactions of list adapter items that start activities. |
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/InvisibleActionTrampolineActivity` | Trampoline activity for handling click interactions of list adapter items that invoke actions that don't launch an activity. |

## Top-level functions summary

|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `<T : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionRunCallback(androidx.glance.action.ActionParameters)(parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that executes a given `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback` implementation |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `<T : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionRunCallback(java.lang.Class,androidx.glance.action.ActionParameters)( callbackClass: https://developer.android.com/reference/java/lang/Class.html<T>, parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters )` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that executes a given `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback` implementation |
| `inline https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `<T : https://developer.android.com/reference/android/content/BroadcastReceiver.html> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionSendBroadcast()()` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/content/BroadcastReceiver.html` when triggered. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionSendBroadcast(android.content.ComponentName)(componentName: https://developer.android.com/reference/android/content/ComponentName.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` specified by the given `https://developer.android.com/reference/android/content/ComponentName.html`. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionSendBroadcast(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches a `https://developer.android.com/reference/android/content/BroadcastReceiver.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `<T : https://developer.android.com/reference/android/content/BroadcastReceiver.html> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionSendBroadcast(java.lang.Class)(receiver: https://developer.android.com/reference/java/lang/Class.html<T>)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/content/BroadcastReceiver.html` when triggered. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionSendBroadcast(kotlin.String,android.content.ComponentName)(action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, componentName: https://developer.android.com/reference/android/content/ComponentName.html?)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` specified by the given action. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionStartActivity(android.content.Intent,androidx.glance.action.ActionParameters)(intent: https://developer.android.com/reference/android/content/Intent.html, parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches an `https://developer.android.com/reference/android/app/Activity.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `@https://developer.android.com/reference/kotlin/androidx/glance/ExperimentalGlanceApi https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionStartActivity(android.content.Intent,androidx.glance.action.ActionParameters,android.os.Bundle)( intent: https://developer.android.com/reference/android/content/Intent.html, parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters, activityOptions: https://developer.android.com/reference/android/os/Bundle.html? )` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches an `https://developer.android.com/reference/android/app/Activity.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. |
| `inline https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `<T : https://developer.android.com/reference/android/app/Service.html> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionStartService(kotlin.Boolean)(isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/app/Service.html` when triggered. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionStartService(android.content.ComponentName,kotlin.Boolean)( componentName: https://developer.android.com/reference/android/content/ComponentName.html, isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the `https://developer.android.com/reference/android/app/Service.html` specified by the given `https://developer.android.com/reference/android/content/ComponentName.html`. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionStartService(android.content.Intent,kotlin.Boolean)(intent: https://developer.android.com/reference/android/content/Intent.html, isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches a `https://developer.android.com/reference/android/app/Service.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. |
| `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` | `<T : https://developer.android.com/reference/android/app/Service.html> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#actionStartService(java.lang.Class,kotlin.Boolean)( service: https://developer.android.com/reference/java/lang/Class.html<T>, isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/app/Service.html` when triggered. |

## Top-level properties summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters.Key<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/package-summary#ToggleableStateKey()` This key is used to access the current checked value for actions that are triggered by compound button interactions (e.g. `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/CheckBox.composable#CheckBox(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.CheckBoxColors,kotlin.Int)`, `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)`). |

## Top-level functions

### actionRunCallback

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/RunCallbackAction.kt+function:actionRunCallback)

```
inline fun <T : ActionCallback> actionRunCallback(
    parameters: ActionParameters = actionParametersOf()
): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that executes a given `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback` implementation

| Parameters |
|---|---|
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action |

### actionRunCallback

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/RunCallbackAction.kt+function:actionRunCallback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun <T : ActionCallback> actionRunCallback(
    callbackClass: Class<T>,
    parameters: ActionParameters = actionParametersOf()
): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that executes a given `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback` implementation

| Parameters |
|---|---|
| `callbackClass: https://developer.android.com/reference/java/lang/Class.html<T>` | the class that implements `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback` |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action |

### actionSendBroadcast

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/SendBroadcastAction.kt+function:actionSendBroadcast)

```
inline fun <T : BroadcastReceiver> actionSendBroadcast(): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/content/BroadcastReceiver.html` when triggered.

### actionSendBroadcast

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/SendBroadcastAction.kt+function:actionSendBroadcast) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun actionSendBroadcast(componentName: ComponentName): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` specified by the given `https://developer.android.com/reference/android/content/ComponentName.html`.

| Parameters |
|---|---|
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | component of the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` to launch |

### actionSendBroadcast

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/SendBroadcastAction.kt+function:actionSendBroadcast) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun actionSendBroadcast(intent: Intent): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches a `https://developer.android.com/reference/android/content/BroadcastReceiver.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. The intent should specify a component with `https://developer.android.com/reference/android/content/Intent.html#setClass(android.content.Context, java.lang.Class&lt;?&gt;)` or `https://developer.android.com/reference/android/content/Intent.html#setComponent(android.content.ComponentName)`.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the `https://developer.android.com/reference/android/content/Intent.html` used to launch the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` |

### actionSendBroadcast

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/SendBroadcastAction.kt+function:actionSendBroadcast) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun <T : BroadcastReceiver> actionSendBroadcast(receiver: Class<T>): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/content/BroadcastReceiver.html` when triggered.

| Parameters |
|---|---|
| `receiver: https://developer.android.com/reference/java/lang/Class.html<T>` | class of the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` to launch |

### actionSendBroadcast

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/SendBroadcastAction.kt+function:actionSendBroadcast) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun actionSendBroadcast(action: String, componentName: ComponentName? = null): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the `https://developer.android.com/reference/android/content/BroadcastReceiver.html` specified by the given action.

| Parameters |
|---|---|
| `action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | of the BroadcastReceiver to launch |
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html? = null` | optional `https://developer.android.com/reference/android/content/ComponentName.html` of the target BroadcastReceiver |

### actionStartActivity

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/StartActivityIntentAction.kt+function:actionStartActivity) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun actionStartActivity(
    intent: Intent,
    parameters: ActionParameters = actionParametersOf()
): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches an `https://developer.android.com/reference/android/app/Activity.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. The intent should specify a component with `https://developer.android.com/reference/android/content/Intent.html#setClass(android.content.Context, java.lang.Class&lt;?&gt;)` or `https://developer.android.com/reference/android/content/Intent.html#setComponent(android.content.ComponentName)`.

This action is supported by app widgets only.

The given intent will be wrapped in a `https://developer.android.com/reference/android/app/PendingIntent.html`. This means that if you create multiple actions with this function, they will be conflated unless the underlying intents are distinct from one another, as defined by `https://developer.android.com/reference/android/content/Intent.html#filterEquals(android.content.Intent)`. For example, if you create two `https://developer.android.com/reference/android/content/Intent.html`s that target the same Activity but only differ by parameters, they will get conflated (the PendingIntent created by the first call to actionStartActivity will be overwritten by the second). A simple way to avoid this is to set a unique data URI on these intents, so that they are distinct as defined by `https://developer.android.com/reference/android/content/Intent.html#filterEquals(android.content.Intent)`. There is more information in the class documentation for `https://developer.android.com/reference/android/app/PendingIntent.html`. If you do not set one, the library will add a unique URI on the intent you provide here.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent used to launch the activity |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action. Parameter values will be added to the activity intent, keyed by the parameter key name string. |

### actionStartActivity

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/StartActivityIntentAction.kt+function:actionStartActivity) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
@ExperimentalGlanceApi
fun actionStartActivity(
    intent: Intent,
    parameters: ActionParameters = actionParametersOf(),
    activityOptions: Bundle? = null
): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches an `https://developer.android.com/reference/android/app/Activity.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. The intent should specify a component with `https://developer.android.com/reference/android/content/Intent.html#setClass(android.content.Context, java.lang.Class&lt;?&gt;)` or `https://developer.android.com/reference/android/content/Intent.html#setComponent(android.content.ComponentName)`.

This action is supported by app widgets only.

The given intent will be wrapped in a `https://developer.android.com/reference/android/app/PendingIntent.html`. This means that if you create multiple actions with this function, they will be conflated unless the underlying intents are distinct from one another, as defined by `https://developer.android.com/reference/android/content/Intent.html#filterEquals(android.content.Intent)`. For example, if you create two `https://developer.android.com/reference/android/content/Intent.html`s that target the same Activity but only differ by parameters, they will get conflated (the PendingIntent created by the first call to actionStartActivity will be overwritten by the second). A simple way to avoid this is to set a unique data URI on these intents, so that they are distinct as defined by `https://developer.android.com/reference/android/content/Intent.html#filterEquals(android.content.Intent)`. There is more information in the class documentation for `https://developer.android.com/reference/android/app/PendingIntent.html`. If you do not set one, the library will add a unique URI on the intent you provide here.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent used to launch the activity |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action. Parameter values will be added to the activity intent, keyed by the parameter key name string. |
| `activityOptions: https://developer.android.com/reference/android/os/Bundle.html? = null` | Additional options built from an `https://developer.android.com/reference/android/app/ActivityOptions.html` to apply to an activity start. |

### actionStartService

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/StartServiceAction.kt+function:actionStartService)

```
inline fun <T : Service> actionStartService(isForegroundService: Boolean = false): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/app/Service.html` when triggered.

| Parameters |
|---|---|
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | set to true when the provided `https://developer.android.com/reference/android/app/Service.html` runs in foreground. This flag is only used for device versions after `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O` that requires foreground service to be launched differently. |

### actionStartService

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/StartServiceAction.kt+function:actionStartService) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun actionStartService(
    componentName: ComponentName,
    isForegroundService: Boolean = false
): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the `https://developer.android.com/reference/android/app/Service.html` specified by the given `https://developer.android.com/reference/android/content/ComponentName.html`.

| Parameters |
|---|---|
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | component of the Service to launch |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | set to true when the provided `https://developer.android.com/reference/android/app/Service.html` runs in foreground. This flag is only used for device versions after `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O` that requires foreground service to be launched differently |

### actionStartService

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/StartServiceAction.kt+function:actionStartService) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun actionStartService(intent: Intent, isForegroundService: Boolean = false): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches a `https://developer.android.com/reference/android/app/Service.html` from the given `https://developer.android.com/reference/android/content/Intent.html` when triggered. The intent should specify a component with `https://developer.android.com/reference/android/content/Intent.html#setClass(android.content.Context, java.lang.Class&lt;?&gt;)` or `https://developer.android.com/reference/android/content/Intent.html#setComponent(android.content.ComponentName)`.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent used to launch the activity |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | set to true when the provided `https://developer.android.com/reference/android/app/Service.html` runs in foreground. This flag is only used for device versions after `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O` that requires foreground service to be launched differently |

### actionStartService

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/StartServiceAction.kt+function:actionStartService) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
fun <T : Service> actionStartService(
    service: Class<T>,
    isForegroundService: Boolean = false
): Action
```

Creates an `https://developer.android.com/reference/kotlin/androidx/glance/action/Action` that launches the specified `https://developer.android.com/reference/android/app/Service.html` when triggered.

| Parameters |
|---|---|
| `service: https://developer.android.com/reference/java/lang/Class.html<T>` | class of the Service to launch |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | set to true when the provided `https://developer.android.com/reference/android/app/Service.html` runs in foreground. This flag is only used for device versions after `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O` that requires foreground service to be launched differently |

## Top-level properties

### ToggleableStateKey

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/action/Toggleable.kt+symbol:ToggleableStateKey) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val ToggleableStateKey: ActionParameters.Key<Boolean>
```

This key is used to access the current checked value for actions that are triggered by compound button interactions (e.g. `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/CheckBox.composable#CheckBox(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.CheckBoxColors,kotlin.Int)`, `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)`). This key is used to retrieve the value from the `https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters` passed to the action.