Stay organized with collections
Save and categorize content based on your preferences.
Callback
interface Callback
callbacks allow services to receive motion events and state change updates.
Summary
Public methods |
abstract Unit |
Called when the framework has sent a motion event to the service.
|
abstract Unit |
Called when the state of motion event dispatch for this display has changed.
|
Public methods
onMotionEvent
abstract fun onMotionEvent(event: MotionEvent): Unit
Called when the framework has sent a motion event to the service.
Parameters |
event |
MotionEvent: the event being passed to the service. This value cannot be null . |
onStateChanged
abstract fun onStateChanged(state: Int): Unit
Called when the state of motion event dispatch for this display has changed.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TouchInteractionController.Callback\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCallback\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/accessibilityservice/TouchInteractionController.Callback \"View this page in Java\") \n\n```\ninterface Callback\n```\n\n|-----------------------------------------------------------------------|\n| [android.accessibilityservice.TouchInteractionController.Callback](#) |\n\ncallbacks allow services to receive motion events and state change updates.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onMotionEvent](#onMotionEvent(android.view.MotionEvent))`(`event:` `[MotionEvent](../view/MotionEvent.html#)`)` Called when the framework has sent a motion event to the service. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStateChanged](#onStateChanged(kotlin.Int))`(`state:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when the state of motion event dispatch for this display has changed. |\n\nPublic methods\n--------------\n\n### onMotionEvent\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onMotionEvent(event: MotionEvent): Unit\n```\n\nCalled when the framework has sent a motion event to the service.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------------|\n| `event` | [MotionEvent](../view/MotionEvent.html#): the event being passed to the service. This value cannot be `null`. |\n\n### onStateChanged\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onStateChanged(state: Int): Unit\n```\n\nCalled when the state of motion event dispatch for this display has changed.\n\n| Parameters ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `state` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the new state of motion event dispatch. Value is [android.accessibilityservice.TouchInteractionController#STATE_CLEAR](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_CLEAR:kotlin.Int), [android.accessibilityservice.TouchInteractionController#STATE_TOUCH_INTERACTING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_TOUCH_INTERACTING:kotlin.Int), [android.accessibilityservice.TouchInteractionController#STATE_TOUCH_EXPLORING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_TOUCH_EXPLORING:kotlin.Int), [android.accessibilityservice.TouchInteractionController#STATE_DRAGGING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_DRAGGING:kotlin.Int), or [android.accessibilityservice.TouchInteractionController#STATE_DELEGATING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_DELEGATING:kotlin.Int) |\n\n**See Also**\n\n- [android.accessibilityservice.TouchInteractionController#STATE_CLEAR](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_CLEAR:kotlin.Int)\n- [android.accessibilityservice.TouchInteractionController#STATE_DELEGATING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_DELEGATING:kotlin.Int)\n- [android.accessibilityservice.TouchInteractionController#STATE_DRAGGING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_DRAGGING:kotlin.Int)\n- [android.accessibilityservice.TouchInteractionController#STATE_TOUCH_EXPLORING](/reference/kotlin/android/accessibilityservice/TouchInteractionController#STATE_TOUCH_EXPLORING:kotlin.Int)"]]