Activity.RequestedOrientation Property

Definition

Return the current requested orientation of the activity. -or- Change the desired orientation of this activity.

public virtual Android.Content.PM.ScreenOrientation RequestedOrientation { [Android.Runtime.Register("getRequestedOrientation", "()I", "GetGetRequestedOrientationHandler")] get; [Android.Runtime.Register("setRequestedOrientation", "(I)V", "GetSetRequestedOrientation_IHandler")] set; }
[<get: Android.Runtime.Register("getRequestedOrientation", "()I", "GetGetRequestedOrientationHandler")>]
[<set: Android.Runtime.Register("setRequestedOrientation", "(I)V", "GetSetRequestedOrientation_IHandler")>]
member this.RequestedOrientation : Android.Content.PM.ScreenOrientation with get, set

Property Value

Returns an orientation constant as used in ActivityInfo#screenOrientation ActivityInfo.screenOrientation.

Attributes

Remarks

Property getter documentation:

Return the current requested orientation of the activity. This will either be the orientation requested in its component's manifest, or the last requested orientation given to #setRequestedOrientation(int).

Java documentation for android.app.Activity.getRequestedOrientation().

Property setter documentation:

Change the desired orientation of this activity. If the activity is currently in the foreground or otherwise impacting the screen orientation, the screen will immediately be changed (possibly causing the activity to be restarted). Otherwise, this will be used the next time the activity is visible.

Java documentation for android.app.Activity.setRequestedOrientation(int).

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