Skip to content

Most visited

Recently visited

navigation
Added in API level 3

SensorEventListener

public interface SensorEventListener

android.hardware.SensorEventListener
Known Indirect Subclasses


Used for receiving notifications from the SensorManager when sensor values have changed.

Summary

Public methods

abstract void onAccuracyChanged(Sensor sensor, int accuracy)

Called when the accuracy of the registered sensor has changed.

abstract void onSensorChanged(SensorEvent event)

Called when sensor values have changed.

Public methods

onAccuracyChanged

Added in API level 3
void onAccuracyChanged (Sensor sensor, 
                int accuracy)

Called when the accuracy of the registered sensor has changed.

See the SENSOR_STATUS_* constants in SensorManager for details.

Parameters
sensor Sensor
accuracy int: The new accuracy of this sensor, one of SensorManager.SENSOR_STATUS_*

onSensorChanged

Added in API level 3
void onSensorChanged (SensorEvent event)

Called when sensor values have changed.

See SensorManager for details on possible sensor types.

See also SensorEvent.

NOTE: The application doesn't own the event object passed as a parameter and therefore cannot hold on to it. The object may be part of an internal pool and may be reused by the framework.

Parameters
event SensorEvent: the SensorEvent.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.