Stay organized with collections
Save and categorize content based on your preferences.
GestureDetector.OnContextClickListener
public
static
interface
GestureDetector.OnContextClickListener
android.view.GestureDetector.OnContextClickListener
|
Known indirect subclasses
|
The listener that is used to notify when a context click occurs. When listening for a
context click ensure that you call GestureDetector.onGenericMotionEvent(android.view.MotionEvent)
in
View.onGenericMotionEvent(MotionEvent)
.
Summary
Public methods
onContextClick
public abstract boolean onContextClick (MotionEvent e)
Notified when a context click occurs.
Parameters |
e |
MotionEvent : The motion event that occurred during the context click.
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.OnContextClickListener\n\nAdded in [API level 23](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nGestureDetector.OnContextClickListener\n======================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/view/GestureDetector.OnContextClickListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nGestureDetector.OnContextClickListener\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------|\n| android.view.GestureDetector.OnContextClickListener |\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 context click occurs. When listening for a\ncontext click ensure that you call [GestureDetector.onGenericMotionEvent(android.view.MotionEvent)](/reference/android/view/GestureDetector#onGenericMotionEvent(android.view.MotionEvent)) in\n[View.onGenericMotionEvent(MotionEvent)](/reference/android/view/View#onGenericMotionEvent(android.view.MotionEvent)).\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[onContextClick](/reference/android/view/GestureDetector.OnContextClickListener#onContextClick(android.view.MotionEvent))`(`[MotionEvent](/reference/android/view/MotionEvent)` e) ` Notified when a context click occurs. |\n\nPublic methods\n--------------\n\n### onContextClick\n\nAdded in [API level 23](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onContextClick (MotionEvent e)\n```\n\nNotified when a context click occurs.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|-------------------------------------------------------------------------------------------------------------|\n| `e` | `MotionEvent`: The motion event that occurred during the context click. This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------------------------------------------------|\n| `boolean` | true if the event is consumed, else false \u003cbr /\u003e |"]]