Most visited

Recently visited

Added in API level 24

SensorEventCallback

public abstract class SensorEventCallback
extends Object implements SensorEventListener2

java.lang.Object
   ↳ android.hardware.SensorEventCallback


用于接收传感器附加信息帧。

Summary

Public constructors

SensorEventCallback()

Public methods

void onAccuracyChanged(Sensor sensor, int accuracy)

当注册传感器的精度发生变化时调用。

void onFlushCompleted(Sensor sensor)

flush()完成后调用。

void onSensorAdditionalInfo(SensorAdditionalInfo info)

当传感器附加信息帧可用时调用。

void onSensorChanged(SensorEvent event)

传感器值发生变化时调用。

Inherited methods

From class java.lang.Object
From interface android.hardware.SensorEventListener2
From interface android.hardware.SensorEventListener

Public constructors

SensorEventCallback

Added in API level 24
SensorEventCallback ()

Public methods

onAccuracyChanged

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

当注册传感器的精度发生变化时调用。

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

也可以看看:

onFlushCompleted

Added in API level 24
void onFlushCompleted (Sensor sensor)

flush()完成后调用。

Parameters
sensor Sensor: The Sensor on which flush was called.

也可以看看:

onSensorAdditionalInfo

Added in API level 24
void onSensorAdditionalInfo (SensorAdditionalInfo info)

当传感器附加信息帧可用时调用。

Parameters
info SensorAdditionalInfo: A SensorAdditionalInfo frame reported from sensor hardware.

onSensorChanged

Added in API level 24
void onSensorChanged (SensorEvent event)

传感器值发生变化时调用。

Parameters
event SensorEvent: the SensorEvent.

也可以看看:

Hooray!