Android Guides | Samples

Android.Views.OrientationEventListener Class

Helper class for receiving notifications from the SensorManager when the orientation of the device has changed.

See Also: OrientationEventListener

Syntax

[Android.Runtime.Register("android/view/OrientationEventListener", DoNotGenerateAcw=true)]
public abstract class OrientationEventListener : Object

Remarks

Helper class for receiving notifications from the SensorManager when the orientation of the device has changed.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3

The members of Android.Views.OrientationEventListener are listed below.

See Also: Object

Public Constructors

Creates a new OrientationEventListener.
Creates a new OrientationEventListener.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
OrientationUnknownInt32 (-1). Returned from onOrientationChanged when the device orientation cannot be determined (typically when the device is in a close to flat position).

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

CanDetectOrientation() : Boolean
Disable()
Disables the OrientationEventListener.
Enable()
Enables the OrientationEventListener so it will monitor the sensor and call OrientationEventListener.OnOrientationChanged(Int32) when the device orientation changes.
abstract
OnOrientationChanged(Int32)
Called when the orientation of the device has changed. orientation parameter is in degrees, ranging from 0 to 359. orientation is 0 degrees when the device is oriented in its natural position, 90 degrees when its left side is at the top, 180 degrees when it is upside down, and 270 degrees when its right side is to the top.