ActivityPanelEntity
class ActivityPanelEntity : PanelEntity
| kotlin.Any | ||||
| ↳ | androidx.xr.scenecore.BaseScenePose | |||
| ↳ | androidx.xr.scenecore.BaseEntity | |||
| ↳ | androidx.xr.scenecore.PanelEntity | |||
| ↳ | androidx.xr.scenecore.ActivityPanelEntity |
ActivityPanelEntity creates a spatial panel for embedding an Activity in Android XR. Users can either use an Intent to launch an Activity in the given panel or provide an instance of Activity to move into this panel. In order to launch and embed an activity, SpatialCapability.SPATIAL_CAPABILITY_EMBED_ACTIVITY capability is required. Calling Entity.dispose on this Entity will destroy the underlying Activity.
Summary
Public companion functions |
|
|---|---|
ActivityPanelEntity |
Public factory function for a spatial ActivityPanelEntity. |
Public functions |
|
|---|---|
Unit |
startActivity(intent: Intent)Starts an |
Unit |
transferActivity(activity: Activity)Transfers the given |
Inherited functions |
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
Inherited properties |
||||||||
|---|---|---|---|---|---|---|---|---|
|
||||||||
|
||||||||
Public companion functions
create
fun create(
session: Session,
pixelDimensions: IntSize2d,
name: String,
pose: Pose = Pose.Identity
): ActivityPanelEntity
Public factory function for a spatial ActivityPanelEntity.
| Parameters | |
|---|---|
session: Session |
XR |
pixelDimensions: IntSize2d |
Bounds for the panel surface in pixels. |
name: String |
Name of the panel. |
pose: Pose = Pose.Identity |
|
| Returns | |
|---|---|
ActivityPanelEntity |
an ActivityPanelEntity instance. |
Public functions
startActivity
fun startActivity(intent: Intent): Unit
Starts an Activity in the given panel. Subsequent calls to this method will replace the already existing Activity in the panel with the new one. The panel will not be visible until an Activity is successfully launched. This will fail if the Scene does not have the SpatialCapability.SPATIAL_CAPABILITY_EMBED_ACTIVITY capability. This method will not provide any information about when the Activity successfully launches.
| Parameters | |
|---|---|
intent: Intent |
Intent to launch the activity. |
transferActivity
fun transferActivity(activity: Activity): Unit
Transfers the given Activity into this panel. This will fail if the application does not have the SpatialCapability.SPATIAL_CAPABILITY_EMBED_ACTIVITY capability.
| Parameters | |
|---|---|
activity: Activity |
Activity to move into this panel. |