OrientationEventListener

Class of android.view · OrientationEventListener.java · Android's reference

public abstract class OrientationEventListener

Tells the device's orientation in degrees from its accelerometer. The device here has no accelerometer (SensorManager lists none), so canDetectOrientation is false and enable starts nothing, as Android's does then.

Fields

public static final int ORIENTATION_UNKNOWN = -1 source

Constructors

public OrientationEventListener(Context context) source
public OrientationEventListener(Context context, int rate) empty body source

Methods

public void enable() source
public void disable() empty body source
public boolean canDetectOrientation() source
public abstract void onOrientationChanged(int orientation) source

0 to 359 degrees, or ORIENTATION_UNKNOWN when the device lies flat


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.