These are some orientations handlers u can use
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.
[Expand]
Inherited Methods
From class java.lang.Object
Object clone()
Creates and returns a copy of this Object.
boolean equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
void finalize()
Is called before the object's memory is being reclaimed by the VM.
final Class getClass()
Returns the unique instance of Class which represents this object's class.
int hashCode()
Returns an integer hash code for this object.
final void notify()
Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.
final void notifyAll()
Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.
String toString()
Returns a string containing a concise, human-readable description of this object.
final void wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.
final void wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.
final void wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
Constants
public static final int ORIENTATION_UNKNOWN
Since: API Level 3
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
public OrientationEventListener (Context context)
Since: API Level 3
Creates a new OrientationEventListener.
Parameters
context for the OrientationEventListener.
public OrientationEventListener (Context context, int rate)
Since: API Level 3
Creates a new OrientationEventListener.
Parameters
context for the OrientationEventListener.
rate 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
public boolean canDetectOrientation ()
Since: API Level 3
public void disable ()
Since: API Level 3
Disables the OrientationEventListener.
public void enable ()
Since: API Level 3
Enables the OrientationEventListener so it will monitor the sensor and call onOrientationChanged(int) when the device orientation changes.
public abstract void onOrientationChanged (int orientation)
Since: API Level 3
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.