# UnmanagedSessionReceiver

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/UnmanagedSessionReceiver.kt+class:androidx.glance.appwidget.UnmanagedSessionReceiver) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/glance#1.2.0)

<br />

```
open class UnmanagedSessionReceiver : BroadcastReceiver
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.content.BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver.html) ||
|   | ↳ | [androidx.glance.appwidget.UnmanagedSessionReceiver](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/UnmanagedSessionReceiver) |

*** ** * ** ***

This receiver responds to lambda action clicks for unmanaged sessions (created by `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/package-summary#(androidx.glance.appwidget.GlanceAppWidget).runComposition(android.content.Context,androidx.glance.GlanceId,android.os.Bundle,kotlin.collections.List,kotlin.Any,android.content.ComponentName)`). In managed sessions that compose UI for a bound widget, the widget's `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/GlanceAppWidgetReceiver` is used as the receiver for lambda actions. However, when running a session with `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/package-summary#(androidx.glance.appwidget.GlanceAppWidget).runComposition(android.content.Context,androidx.glance.GlanceId,android.os.Bundle,kotlin.collections.List,kotlin.Any,android.content.ComponentName)`, there is no guarantee that the widget is attached to some GlanceAppWidgetReceiver. Instead, unmanaged sessions register themselves to receive lambdas while they are running (with `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/UnmanagedSessionReceiver.Companion#registerSession(kotlin.Int,androidx.glance.appwidget.AppWidgetSession)`), and set their lambda target to `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/UnmanagedSessionReceiver`. This is also used by `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/GlanceRemoteViewsService` to provide list items for unmanaged sessions.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/UnmanagedSessionReceiver#UnmanagedSessionReceiver()()` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/UnmanagedSessionReceiver#onReceive(android.content.Context,android.content.Intent)(context: https://developer.android.com/reference/android/content/Context.html?, intent: https://developer.android.com/reference/android/content/Intent.html?)` |

### Inherited functions

From [android.content.BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#abortBroadcast()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#clearAbortBroadcast()()` `https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getResultExtras(boolean)(makeMap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#goAsync()()` `https://developer.android.com/reference/android/os/IBinder.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#peekService(android.content.Context, android.content.Intent)(myContext: https://developer.android.com/reference/android/content/Context.html, service: https://developer.android.com/reference/android/content/Intent.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setOrderedHint(boolean)(isOrdered: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setResult(int, java.lang.String, android.os.Bundle)(code: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, data: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, extras: https://developer.android.com/reference/android/os/Bundle.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setResultExtras(android.os.Bundle)(extras: https://developer.android.com/reference/android/os/Bundle.html)`

### Inherited properties

From [android.content.BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#abortBroadcast` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#debugUnregister` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#isInitialStickyBroadcast` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#isOrderedBroadcast` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#resultCode` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#resultData` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#sentFromPackage` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/BroadcastReceiver.html#sentFromUid`

## Public constructors

### UnmanagedSessionReceiver

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/glance#1.2.0)

```
UnmanagedSessionReceiver()
```

## Public functions

### onReceive

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/glance#1.2.0)

```
open fun onReceive(context: Context?, intent: Intent?): Unit
```