LaunchUtils
public final class LaunchUtils
Summary
Public methods |
|
|---|---|
static final @NonNull Bundle |
createBundleForFullSpaceLaunch(Returns a |
static final @NonNull Bundle |
createBundleForFullSpaceLaunchWithEnvironmentInherited(Returns a |
Public methods
createBundleForFullSpaceLaunch
public static final @NonNull Bundle createBundleForFullSpaceLaunch(
@NonNull Session session,
@NonNull Bundle bundle
)
Returns a Bundle with the necessary entries to request that a new Activity be launched directly into Full Space.
Use Activity.startActivity with the returned bundle to launch an Activity directly into Full Space. Use bundles returned by android.app.ActivityOptions.toBundle or androidx.core.app.ActivityOptionsCompat.toBundle as arguments to this function to preserve the existing options.
The provided bundle must have the android.content.Intent.FLAG_ACTIVITY_NEW_TASK set.
The launch request will not be honored if it is not started from a focused Activity context or if the androidx.xr.runtime.manifest.PROPERTY_XR_ACTIVITY_START_MODE manifest property is set to a value other than androidx.xr.runtime.manifest.XR_ACTIVITY_START_MODE_UNDEFINED for the activity being launched.
createBundleForFullSpaceLaunchWithEnvironmentInherited
public static final @NonNull Bundle createBundleForFullSpaceLaunchWithEnvironmentInherited(
@NonNull Session session,
@NonNull Bundle bundle
)
Returns a Bundle with the necessary entries to request that a new Activity be launched directly into Full Space while inheriting the environment from the launching activity.
Use Activity.startActivity with the returned bundle to launch an Activity directly into Full Space while inheriting the existing environment. Use bundles returned by android.app.ActivityOptions.toBundle or androidx.core.app.ActivityOptionsCompat.toBundle as arguments to this function to preserve the existing options.
When launched, the Activity will be in Full Space and will inherit the environment from the launching activity. If the inherited environment needs to be animated, the launching activity has to continue updating the environment even after the activity is put into the stopped state.
The provided bundle must have the android.content.Intent.FLAG_ACTIVITY_NEW_TASK set.
The launch request will not be honored if it is not started from a focused Activity context or if the androidx.xr.runtime.manifest.PROPERTY_XR_ACTIVITY_START_MODE manifest property is set to a value other than androidx.xr.runtime.manifest.XR_ACTIVITY_START_MODE_UNDEFINED for the activity being launched.
For security reasons, Z-testing for the new activity is disabled, and the activity is always drawn on top of the inherited environment. Because Z-testing is disabled, the activity should not spatialize itself.