---
title: "SpatialActivityPanelController"
description: "A state holder and controller for managing the embedded [android.app.Activity] lifecycle within a [SpatialActivityPanel]."
type: "class"
lastmod: "2026-09-24"
---
## API Reference

> Source set: Android

```kotlin
public class SpatialActivityPanelController(initialIntent: Intent)
```

A state holder and controller for managing the embedded `android.app.Activity` lifecycle within a
[SpatialActivityPanel](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialActivityPanel/api).

This controller acts as a bridge between standard imperative intent dispatching and the
declarative Compose XR environment. It maintains a queue of `Intent`s. If the associated
[SpatialActivityPanel](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialActivityPanel/api) is present in the composition and actively listening, incoming Intents are
dispatched immediately. If the panel is not yet ready, Intents are queued and will be drained
sequentially the moment the panel binds to this controller.

This class is thread-safe and safe to call from background threads (e.g. calling `startActivity`
concurrently). It uses non-blocking concurrent structures rather than locks to prevent blocking
the main recomposition thread.

#### Parameters

| | |
| --- | --- |
| initialIntent | The initial `Intent` to queue for execution inside the activity panel. |

## Functions

### startActivity

> Source set: Android

```kotlin
public fun startActivity(intent: Intent)
```

Dispatches an `Intent` to the [SpatialActivityPanel](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialActivityPanel/api).

If the panel is active and bound to this controller, the intent is processed immediately.
Otherwise, the intent is placed in a pending queue and will be processed once the panel
becomes active.

#### Parameters

| | |
| --- | --- |
| intent | The `Intent` to launch in the activity panel. |
