Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/hardware/SensorEventCallback#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/SensorEventCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/SensorEventCallback#inhmethods)

# SensorEventCallback

*** ** * ** ***

` public abstract class SensorEventCallback `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/hardware/SensorEventListener2 `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.SensorEventCallback |

<br />

*** ** * ** ***

Used for receiving sensor additional information frames.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/SensorEventCallback#SensorEventCallback()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorEventCallback#onAccuracyChanged(android.hardware.Sensor,%20int)(https://developer.android.com/reference/android/hardware/Sensor sensor, int accuracy) ` Called when the accuracy of the registered sensor has changed. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorEventCallback#onFlushCompleted(android.hardware.Sensor)(https://developer.android.com/reference/android/hardware/Sensor sensor) ` Called after flush() is completed. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorEventCallback#onSensorAdditionalInfo(android.hardware.SensorAdditionalInfo)(https://developer.android.com/reference/android/hardware/SensorAdditionalInfo info) ` Called when a sensor additional information frame is available. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorEventCallback#onSensorChanged(android.hardware.SensorEvent)(https://developer.android.com/reference/android/hardware/SensorEvent event) ` Called when sensor values have changed. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/hardware/SensorEventListener2 ` ` abstract void` ` https://developer.android.com/reference/android/hardware/SensorEventListener2#onFlushCompleted(android.hardware.Sensor)(https://developer.android.com/reference/android/hardware/Sensor sensor) `

Called after flush() is completed.
From interface ` https://developer.android.com/reference/android/hardware/SensorEventListener ` ` abstract void` ` https://developer.android.com/reference/android/hardware/SensorEventListener#onAccuracyChanged(android.hardware.Sensor,%20int)(https://developer.android.com/reference/android/hardware/Sensor sensor, int accuracy) `

Called when the accuracy of the registered sensor has changed.
` abstract void` ` https://developer.android.com/reference/android/hardware/SensorEventListener#onSensorChanged(android.hardware.SensorEvent)(https://developer.android.com/reference/android/hardware/SensorEvent event) `

Called when there is a new sensor event.

## Public constructors

### SensorEventCallback

```
public SensorEventCallback ()
```

<br />

<br />

## Public methods

### onAccuracyChanged

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onAccuracyChanged (Sensor sensor, 
                int accuracy)
```

Called when the accuracy of the registered sensor has changed.

<br />

| Parameters ||
|---|---|
| `sensor` | `Sensor` <br /> |
| `accuracy` | `int`: The new accuracy of this sensor, one of `SensorManager.SENSOR_STATUS_*` <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorEventListener#onAccuracyChanged(android.hardware.Sensor,%20int)`

### onFlushCompleted

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onFlushCompleted (Sensor sensor)
```

Called after flush() is completed.

<br />

| Parameters ||
|---|---|
| `sensor` | `Sensor`: The `https://developer.android.com/reference/android/hardware/Sensor` on which flush was called. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorEventListener2#onFlushCompleted(android.hardware.Sensor)`

### onSensorAdditionalInfo

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onSensorAdditionalInfo (SensorAdditionalInfo info)
```

Called when a sensor additional information frame is available.

<br />

| Parameters ||
|---|---|
| `info` | `SensorAdditionalInfo`: A `https://developer.android.com/reference/android/hardware/SensorAdditionalInfo` frame reported from sensor hardware. <br /> |

### onSensorChanged

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onSensorChanged (SensorEvent event)
```

Called when sensor values have changed.

<br />

| Parameters ||
|---|---|
| `event` | `SensorEvent`: the `https://developer.android.com/reference/android/hardware/SensorEvent`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorEventListener#onSensorChanged(android.hardware.SensorEvent)`