public class LightSensorListener
extends java.lang.Object
implements android.hardware.SensorEventListener
This class uses for receiving notifications from the SensorManager when light sensor values have changed.
| Constructor and Description |
|---|
LightSensorListener(android.content.Context context,
SensorResultHandler resultHandler)
Constructs new listener with the given Context and
SensorResultHandler objects. |
| Modifier and Type | Method and Description |
|---|---|
void |
onAccuracyChanged(android.hardware.Sensor sensor,
int accuracy) |
void |
onSensorChanged(android.hardware.SensorEvent event) |
void |
start()
Unregister the available listener and register new listener for sensor value updates.
|
void |
stop()
Unregister the light updates listener, if any.
|
public LightSensorListener(android.content.Context context,
SensorResultHandler resultHandler)
throws java.lang.NullPointerException
SensorResultHandler objects.context - An instance of ContextresultHandler - An instance of SensorResultHandlerjava.lang.NullPointerException - if Context is null.public void start()
Unregister the available listener and register new listener for sensor value updates.
public void stop()
Unregister the light updates listener, if any.
public void onAccuracyChanged(android.hardware.Sensor sensor,
int accuracy)
onAccuracyChanged in interface android.hardware.SensorEventListenerpublic void onSensorChanged(android.hardware.SensorEvent event)
onSensorChanged in interface android.hardware.SensorEventListener