# WearWidgetConfigExtras

Artifact: [androidx.glance.wear:wear](https://developer.android.com/jetpack/androidx/releases/glance-wear) [View Source](https://cs.android.com/search?q=file:androidx/glance/wear/WearWidgetConfigExtras.kt+class:androidx.glance.wear.WearWidgetConfigExtras) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)


```
class WearWidgetConfigExtras
```

<br />

*** ** * ** ***

Holds the configuration parameters passed to a Wear Widget configuration activity via its launching `https://developer.android.com/reference/android/content/Intent.html`.

When the Wear OS host launches a widget configuration activity (specified via `configIntentAction` in the `<wearwidget-provider>` XML metadata and matching `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#CATEGORY_PROVIDER_CONFIG()`), it includes the target widget instance ID and provider service `https://developer.android.com/reference/android/content/ComponentName.html` in the launching intent's extras. Use `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#fromIntent(android.content.Intent)` to extract these values in your configuration activity.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#CATEGORY_PROVIDER_CONFIG()` Category for widget provider configuration activities. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#EXTRA_CONFIG_PROVIDER_COMPONENT()` Intent extra used to supply the widget provider `https://developer.android.com/reference/android/content/ComponentName.html` (the `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetService`) to a widget provider configuration activity. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#EXTRA_CONFIG_WIDGET_ID()` Intent extra used to supply the widget instance ID (`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html`, matching `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#id()`) to a widget provider configuration activity. |

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras?` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#fromIntent(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Extracts `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras` from the launching configuration `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras.Companion#fromIntent(android.content.Intent)`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#WearWidgetConfigExtras(androidx.glance.wear.core.WidgetInstanceId,android.content.ComponentName)( instanceId: https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId, provider: https://developer.android.com/reference/android/content/ComponentName.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#instanceId()` The `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId` of the widget instance being configured. |
| `https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#provider()` The `https://developer.android.com/reference/android/content/ComponentName.html` of the `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetService` providing the widget. |

## Constants

### CATEGORY_PROVIDER_CONFIG

```
const val CATEGORY_PROVIDER_CONFIG: String
```

Category for widget provider configuration activities.

The configuration activity launched for configuring a widget provider must specify this category in its intent filter.

For example, in `AndroidManifest.xml`:

```kotlin
<activity
    android:name=".ProviderConfigurationActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="com.example.ACTION_CONFIGURE_WIDGET" />
        <category android:name="com.google.android.clockwork.tiles.category.PROVIDER_CONFIG" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>
```

### EXTRA_CONFIG_PROVIDER_COMPONENT

```
const val EXTRA_CONFIG_PROVIDER_COMPONENT: String
```

Intent extra used to supply the widget provider `https://developer.android.com/reference/android/content/ComponentName.html` (the `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetService`) to a widget provider configuration activity.

### EXTRA_CONFIG_WIDGET_ID

```
const val EXTRA_CONFIG_WIDGET_ID: String
```

Intent extra used to supply the widget instance ID (`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html`, matching `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#id()`) to a widget provider configuration activity.

## Public companion functions

### fromIntent

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
fun fromIntent(intent: Intent): WearWidgetConfigExtras?
```

Extracts `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras` from the launching configuration `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras.Companion#fromIntent(android.content.Intent)`.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The `https://developer.android.com/reference/android/content/Intent.html` that launched the widget configuration activity. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras?` | The parsed `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras`, or `null` if the `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras.Companion#fromIntent(android.content.Intent)` does not have `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#CATEGORY_PROVIDER_CONFIG()` or if the required extras (`https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#EXTRA_CONFIG_WIDGET_ID()` and `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras#EXTRA_CONFIG_PROVIDER_COMPONENT()`) are missing or invalid. |

## Public constructors

### WearWidgetConfigExtras

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
WearWidgetConfigExtras(
    instanceId: WidgetInstanceId,
    provider: ComponentName
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### instanceId

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
val instanceId: WidgetInstanceId
```

The `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId` of the widget instance being configured.

### provider

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
val provider: ComponentName
```

The `https://developer.android.com/reference/android/content/ComponentName.html` of the `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetService` providing the widget.