Class

SpatialActivityPanelController

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

Source set: Android
public class SpatialActivityPanelController(initialIntent: Intent)

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.

Parameters

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

Functions

startActivity

Source set: Android
public fun startActivity(intent: Intent)

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 The Intent to launch in the activity panel.

Content updated: