Activity.SetVrModeEnabled(Boolean, ComponentName) Method

Definition

Enable or disable virtual reality (VR) mode for this Activity.

[Android.Runtime.Register("setVrModeEnabled", "(ZLandroid/content/ComponentName;)V", "GetSetVrModeEnabled_ZLandroid_content_ComponentName_Handler", ApiSince=24)]
public virtual void SetVrModeEnabled(bool enabled, Android.Content.ComponentName requestedComponent);
[<Android.Runtime.Register("setVrModeEnabled", "(ZLandroid/content/ComponentName;)V", "GetSetVrModeEnabled_ZLandroid_content_ComponentName_Handler", ApiSince=24)>]
abstract member SetVrModeEnabled : bool * Android.Content.ComponentName -> unit
override this.SetVrModeEnabled : bool * Android.Content.ComponentName -> unit

Parameters

enabled
Boolean

boolean: true to enable this mode.

requestedComponent
ComponentName

ComponentName: the name of the component to use as a VrListenerService while VR mode is enabled. This value cannot be null.

Attributes

Remarks

Enable or disable virtual reality (VR) mode for this Activity. VR mode is a hint to Android system to switch to a mode optimized for VR applications while this Activity has user focus.

It is recommended that applications additionally declare R.attr.enableVrMode in their manifest to allow for smooth activity transitions when switching between VR activities.

If the requested VrListenerService component is not available, VR mode will not be started. Developers can handle this case as follows:

See also:

Throws: PackageManager.NameNotFoundException if the given component to run as a VrListenerService is not installed, or has not been enabled in user settings.

Android reference for android.app.Activity.setVrModeEnabled.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to