Stay organized with collections
Save and categorize content based on your preferences.
GestureDetector.OnDoubleTapListener
public
static
interface
GestureDetector.OnDoubleTapListener
android.view.GestureDetector.OnDoubleTapListener
|
Known indirect subclasses
|
The listener that is used to notify when a double-tap or a confirmed
single-tap occur.
Summary
Public methods
onDoubleTap
public abstract boolean onDoubleTap (MotionEvent e)
Notified when a double-tap occurs. Triggered on the down event of second tap.
Parameters |
e |
MotionEvent : The down motion event of the first tap of the double-tap.
This value cannot be null . |
Returns |
boolean |
true if the event is consumed, else false |
onDoubleTapEvent
public abstract boolean onDoubleTapEvent (MotionEvent e)
Notified when an event within a double-tap gesture occurs, including
the down, move, and up events.
Parameters |
e |
MotionEvent : The motion event that occurred during the double-tap gesture.
This value cannot be null . |
Returns |
boolean |
true if the event is consumed, else false |
onSingleTapConfirmed
public abstract boolean onSingleTapConfirmed (MotionEvent e)
Notified when a single-tap occurs.
Unlike OnGestureListener.onSingleTapUp(MotionEvent)
, this
will only be called after the detector is confident that the user's
first tap is not followed by a second tap leading to a double-tap
gesture.
Parameters |
e |
MotionEvent : The down motion event of the single-tap.
This value cannot be null . |
Returns |
boolean |
true if the event is consumed, else false |
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,["# GestureDetector.OnDoubleTapListener\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nGestureDetector.OnDoubleTapListener\n===================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/view/GestureDetector.OnDoubleTapListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nGestureDetector.OnDoubleTapListener\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------|\n| android.view.GestureDetector.OnDoubleTapListener |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [GestureDetector.SimpleOnGestureListener](/reference/android/view/GestureDetector.SimpleOnGestureListener) |------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------| | [GestureDetector.SimpleOnGestureListener](/reference/android/view/GestureDetector.SimpleOnGestureListener) | A convenience class to extend when you only want to listen for a subset of all the gestures. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe listener that is used to notify when a double-tap or a confirmed\nsingle-tap occur.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[onDoubleTap](/reference/android/view/GestureDetector.OnDoubleTapListener#onDoubleTap(android.view.MotionEvent))`(`[MotionEvent](/reference/android/view/MotionEvent)` e) ` Notified when a double-tap occurs. |\n| ` abstract boolean` | ` `[onDoubleTapEvent](/reference/android/view/GestureDetector.OnDoubleTapListener#onDoubleTapEvent(android.view.MotionEvent))`(`[MotionEvent](/reference/android/view/MotionEvent)` e) ` Notified when an event within a double-tap gesture occurs, including the down, move, and up events. |\n| ` abstract boolean` | ` `[onSingleTapConfirmed](/reference/android/view/GestureDetector.OnDoubleTapListener#onSingleTapConfirmed(android.view.MotionEvent))`(`[MotionEvent](/reference/android/view/MotionEvent)` e) ` Notified when a single-tap occurs. |\n\nPublic methods\n--------------\n\n### onDoubleTap\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onDoubleTap (MotionEvent e)\n```\n\nNotified when a double-tap occurs. Triggered on the down event of second tap.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|--------------------------------------------------------------------------------------------------------------|\n| `e` | `MotionEvent`: The down motion event of the first tap of the double-tap. This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------------------------------------------------|\n| `boolean` | true if the event is consumed, else false \u003cbr /\u003e |\n\n### onDoubleTapEvent\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onDoubleTapEvent (MotionEvent e)\n```\n\nNotified when an event within a double-tap gesture occurs, including\nthe down, move, and up events.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|------------------------------------------------------------------------------------------------------------------|\n| `e` | `MotionEvent`: The motion event that occurred during the double-tap gesture. This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------------------------------------------------|\n| `boolean` | true if the event is consumed, else false \u003cbr /\u003e |\n\n### onSingleTapConfirmed\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onSingleTapConfirmed (MotionEvent e)\n```\n\nNotified when a single-tap occurs.\n\n\nUnlike [OnGestureListener.onSingleTapUp(MotionEvent)](/reference/android/view/GestureDetector.OnGestureListener#onSingleTapUp(android.view.MotionEvent)), this\nwill only be called after the detector is confident that the user's\nfirst tap is not followed by a second tap leading to a double-tap\ngesture.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|---------------------------------------------------------------------------------------------|\n| `e` | `MotionEvent`: The down motion event of the single-tap. This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------------------------------------------------|\n| `boolean` | true if the event is consumed, else false \u003cbr /\u003e |"]]