sensorManager.unregisterListener(flipDetector.sensorEventListener);
}
}
public void startOrientationDetection(
OrientationDetector.OrientationListener orientationListener) {
<BUG>if (sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION) != null) {
orientationDetector = new OrientationDetector(orientationListener);
sensorManager.registerListener(orientationDetector.sensorEventListener,

sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION),</BUG>
SensorManager.SENSOR_DELAY_NORMAL);

sensorManager.unregisterListener(flipDetector.sensorEventListener);
}
}
public void startOrientationDetection(
OrientationDetector.OrientationListener orientationListener) {
Sensor accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
Sensor magnetometer = sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
if (accelerometer != null && magnetometer != null) {
orientationDetector = new OrientationDetector(orientationListener);
sensorManager.registerListener(orientationDetector.sensorEventListener, accelerometer,
