# TouchInteractionController.Callback

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

# TouchInteractionController.Callback

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/accessibilityservice/TouchInteractionController.Callback "View this page in Kotlin")\|Java

`
public
static


interface
TouchInteractionController.Callback
`  
`


`

|------------------------------------------------------------------|
| android.accessibilityservice.TouchInteractionController.Callback |

<br />

*** ** * ** ***

callbacks allow services to receive motion events and state change updates.

## Summary

|                                                                                                                                                                  ### Public methods                                                                                                                                                                  ||
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onMotionEvent](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController.Callback#onMotionEvent(android.view.MotionEvent))`(`[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent)` event) ` Called when the framework has sent a motion event to the service. |
| ` abstract void` | ` `[onStateChanged](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController.Callback#onStateChanged(int))`(int state) ` Called when the state of motion event dispatch for this display has changed.                                                                                       |

## Public methods

### onMotionEvent

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

```
public abstract void onMotionEvent (MotionEvent event)
```

Called when the framework has sent a motion event to the service.

<br />

|                                            Parameters                                             ||
|---------|------------------------------------------------------------------------------------------|
| `event` | `MotionEvent`: the event being passed to the service. This value cannot be`null`. <br /> |

### onStateChanged

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

```
public abstract void onStateChanged (int state)
```

Called when the state of motion event dispatch for this display has changed.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `state` | `int`: the new state of motion event dispatch. Value is[TouchInteractionController.STATE_CLEAR](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_CLEAR),[TouchInteractionController.STATE_TOUCH_INTERACTING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_TOUCH_INTERACTING),[TouchInteractionController.STATE_TOUCH_EXPLORING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_TOUCH_EXPLORING),[TouchInteractionController.STATE_DRAGGING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_DRAGGING), or[TouchInteractionController.STATE_DELEGATING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_DELEGATING) <br /> |

**See also:**

- [TouchInteractionController.STATE_CLEAR](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_CLEAR)
- [TouchInteractionController.STATE_DELEGATING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_DELEGATING)
- [TouchInteractionController.STATE_DRAGGING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_DRAGGING)
- [TouchInteractionController.STATE_TOUCH_EXPLORING](https://developer.android.com/reference/android/accessibilityservice/TouchInteractionController#STATE_TOUCH_EXPLORING)