FileDocCategorySizeDatePackage
OrientationListener.javaAPI DocAndroid 1.5 API3750Wed May 06 22:41:56 BST 2009android.view

OrientationListener

public abstract class OrientationListener extends Object implements android.hardware.SensorListener
Helper class for receiving notifications from the SensorManager when the orientation of the device has changed.
deprecated
use {@link android.view.OrientationEventListener} instead. This class internally uses the OrientationEventListener.

Fields Summary
private OrientationEventListener
mOrientationEventLis
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).
Constructors Summary
public OrientationListener(android.content.Context context)
Creates a new OrientationListener.

param
context for the OrientationListener.


                   
       
        mOrientationEventLis = new OrientationEventListenerInternal(context);
    
public OrientationListener(android.content.Context context, int rate)
Creates a new OrientationListener.

param
context for the OrientationListener.
param
rate at which sensor events are processed (see also {@link android.hardware.SensorManager SensorManager}). Use the default value of {@link android.hardware.SensorManager#SENSOR_DELAY_NORMAL SENSOR_DELAY_NORMAL} for simple screen orientation change detection.

        mOrientationEventLis = new OrientationEventListenerInternal(context, rate);
    
Methods Summary
public voiddisable()
Disables the OrientationListener.

        mOrientationEventLis.disable();
    
public voidenable()
Enables the OrientationListener so it will monitor the sensor and call {@link #onOrientationChanged} when the device orientation changes.

        mOrientationEventLis.enable();
    
public voidonAccuracyChanged(int sensor, int accuracy)

    
public abstract voidonOrientationChanged(int orientation)
Look at {@link android.view.OrientationEventListener#onOrientationChanged} for method description and usage

param
orientation The new orientation of the device.
see
#ORIENTATION_UNKNOWN

public voidonSensorChanged(int sensor, float[] values)

        // just ignore the call here onOrientationChanged is invoked anyway