&& shakeDetector != null) {
sensorManager.unregisterListener(shakeDetector.sensorEventListener);
}
}
public void startLightetection(LightDetector.LightListener lightListener) {
<BUG>if (sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT) != null) {

lightDetector = new LightDetector(lightListener);
sensorManager.registerListener(lightDetector.sensorEventListener,

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

&& shakeDetector != null) {
sensorManager.unregisterListener(shakeDetector.sensorEventListener);
}
}
public void startLightetection(LightDetector.LightListener lightListener) {
final Sensor sensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
if (sensor != null) {
lightDetector = new LightDetector(lightListener);
sensorManager.registerListener(lightDetector.sensorEventListener, sensor,
SensorManager.SENSOR_DELAY_NORMAL);
}
}
