# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Ctors | Methods | Inherited Methods

# OrientationEventListener

`public abstract class OrientationEventListener`
`extends Object` ``

java.lang.Object
↳ | android.view.OrientationEventListener

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

## Summary

### Constants
`int` | `ORIENTATION_UNKNOWN` Returned from onOrientationChanged when the device orientation cannot be determined (typically when the device is in a close to flat position).

### Public constructors
`OrientationEventListener(Context context)` Creates a new OrientationEventListener.
`OrientationEventListener(Context context, int rate)` Creates a new OrientationEventListener.

### Public methods
`boolean` | `canDetectOrientation()`
`void` | `disable()` Disables the OrientationEventListener.
`void` | `enable()` Enables the OrientationEventListener so it will monitor the sensor and call `onOrientationChanged(int)` when the device orientation changes.
`abstract void` | `onOrientationChanged(int orientation)` Called when the orientation of the device has changed.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### ORIENTATION_UNKNOWN

    public static final int ORIENTATION_UNKNOWN

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

See also:

- `onOrientationChanged(int)`

Constant Value: -1 (0xffffffff)

## Public constructors

### OrientationEventListener

    public OrientationEventListener (Context context)

Creates a new OrientationEventListener.

Parameters
`context` | `Context`: for the OrientationEventListener.

### OrientationEventListener

    public OrientationEventListener (Context context,
                    int rate)

Creates a new OrientationEventListener.

Parameters
`context` | `Context`: for the OrientationEventListener.
`rate` | `int`: at which sensor events are processed (see also `SensorManager`). Use the default value of `SENSOR_DELAY_NORMAL` for simple screen orientation change detection.

## Public methods

### canDetectOrientation

    public boolean canDetectOrientation ()

Returns
`boolean` |

### disable

    public void disable ()

Disables the OrientationEventListener.

### enable

    public void enable ()

Enables the OrientationEventListener so it will monitor the sensor and call `onOrientationChanged(int)` when the device orientation changes.

### onOrientationChanged

    public abstract void onOrientationChanged (int orientation)

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. `ORIENTATION_UNKNOWN` is returned when the device is close to flat and the orientation cannot be determined.

Parameters
`orientation` | `int`: The new orientation of the device.

See also:

- `ORIENTATION_UNKNOWN`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*