Stay organized with collections
Save and categorize content based on your preferences.
View.OnCapturedPointerListener
public
static
interface
View.OnCapturedPointerListener
android.view.View.OnCapturedPointerListener
|
Interface definition for a callback to be invoked when a captured pointer event
is being dispatched this view. The callback will be invoked before the event is
given to the view.
Summary
Public methods
onCapturedPointer
public abstract boolean onCapturedPointer (View view,
MotionEvent event)
Called when a captured pointer event is dispatched to a view.
Parameters |
view |
View : The view this event has been dispatched to. |
event |
MotionEvent : The captured event. |
Returns |
boolean |
True if the listener has consumed the event, false otherwise. |
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,["# View.OnCapturedPointerListener\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nView.OnCapturedPointerListener\n==============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/view/View.OnCapturedPointerListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nView.OnCapturedPointerListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------|\n| android.view.View.OnCapturedPointerListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when a captured pointer event\nis being dispatched this view. The callback will be invoked before the event is\ngiven to the view.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[onCapturedPointer](/reference/android/view/View.OnCapturedPointerListener#onCapturedPointer(android.view.View,%20android.view.MotionEvent))`(`[View](/reference/android/view/View)` view, `[MotionEvent](/reference/android/view/MotionEvent)` event) ` Called when a captured pointer event is dispatched to a view. |\n\nPublic methods\n--------------\n\n### onCapturedPointer\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onCapturedPointer (View view, \n MotionEvent event)\n```\n\nCalled when a captured pointer event is dispatched to a view.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|------------------------------------------------------------|\n| `view` | `View`: The view this event has been dispatched to. \u003cbr /\u003e |\n| `event` | `MotionEvent`: The captured event. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|----------------------------------------------------------------------|\n| `boolean` | True if the listener has consumed the event, false otherwise. \u003cbr /\u003e |"]]