Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/view/GestureDetector.OnContextClickListener#pubmethods)

# GestureDetector.OnContextClickListener

*** ** * ** ***

` public static interface GestureDetector.OnContextClickListener `   
` `

|---|
| android.view.GestureDetector.OnContextClickListener |

Known indirect subclasses [GestureDetector.SimpleOnGestureListener](https://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener) [GestureDetector.SimpleOnGestureListener](https://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener) A convenience class to extend when you only want to listen for a subset of all the gestures.   

*** ** * ** ***

The listener that is used to notify when a context click occurs. When listening for a context click ensure that you call `https://developer.android.com/reference/android/view/GestureDetector#onGenericMotionEvent(android.view.MotionEvent)` in `https://developer.android.com/reference/android/view/View#onGenericMotionEvent(android.view.MotionEvent)`.

## Summary

| ### Public methods ||
|---|---|
| ` abstract boolean` | ` https://developer.android.com/reference/android/view/GestureDetector.OnContextClickListener#onContextClick(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent e) ` Notified when a context click occurs. |

## Public methods

### onContextClick

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

```
public abstract boolean onContextClick (MotionEvent e)
```

Notified when a context click occurs.

<br />

| Parameters ||
|---|---|
| `e` | `MotionEvent`: The motion event that occurred during the context click. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the event is consumed, else false <br /> |