SpatialActivityPanelController

class SpatialActivityPanelController


A state holder and controller for managing the embedded android.app.Activity lifecycle within a SpatialActivityPanel.

This controller acts as a bridge between standard imperative intent dispatching and the declarative Compose XR environment. It maintains a queue of Intents. If the associated SpatialActivityPanel 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.

Summary

Public constructors

Public functions

Unit

Dispatches an Intent to the SpatialActivityPanel.

Public constructors

SpatialActivityPanelController

Added in 1.0.0-beta01
SpatialActivityPanelController(initialIntent: Intent)
Parameters
initialIntent: Intent

The initial Intent to queue for execution inside the activity panel.

Public functions

startActivity

Added in 1.0.0-beta01
fun startActivity(intent: Intent): Unit

Dispatches an Intent to the SpatialActivityPanel.

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: Intent

The Intent to launch in the activity panel.