# View.OnCapturedPointerListener

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

# View.OnCapturedPointerListener

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/View.OnCapturedPointerListener "View this page in Kotlin")\|Java

`
public
static


interface
View.OnCapturedPointerListener
`  
`


`

|---------------------------------------------|
| android.view.View.OnCapturedPointerListener |

<br />

*** ** * ** ***

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                                                                                                                                                                                                           ||
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[onCapturedPointer](https://developer.android.com/reference/android/view/View.OnCapturedPointerListener#onCapturedPointer(android.view.View,%20android.view.MotionEvent))`(`[View](https://developer.android.com/reference/android/view/View)` view, `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent)` event) ` Called when a captured pointer event is dispatched to a view. |

## Public methods

### onCapturedPointer

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

```
public abstract boolean onCapturedPointer (View view, 
                MotionEvent event)
```

Called when a captured pointer event is dispatched to a view.

<br />

|                             Parameters                              ||
|---------|------------------------------------------------------------|
| `view`  | `View`: The view this event has been dispatched to. <br /> |
| `event` | `MotionEvent`: The captured event. <br />                  |

|                                     Returns                                     ||
|-----------|----------------------------------------------------------------------|
| `boolean` | True if the listener has consumed the event, false otherwise. <br /> |