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

# View.OnGenericMotionListener

*** ** * ** ***

` public static interface View.OnGenericMotionListener `   
` `

|---|
| android.view.View.OnGenericMotionListener |

<br />

*** ** * ** ***

Interface definition for a callback to be invoked when a generic motion event is dispatched to this view. The callback will be invoked before the generic motion event is given to the view.

## Summary

| ### Public methods ||
|---|---|
| ` abstract boolean` | ` https://developer.android.com/reference/android/view/View.OnGenericMotionListener#onGenericMotion(android.view.View,%20android.view.MotionEvent)(https://developer.android.com/reference/android/view/View v, https://developer.android.com/reference/android/view/MotionEvent event) ` Called when a generic motion event is dispatched to a view. |

## Public methods

### onGenericMotion

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

```
public abstract boolean onGenericMotion (View v, 
                MotionEvent event)
```

Called when a generic motion event is dispatched to a view. This allows listeners to get a chance to respond before the target view.

<br />

| Parameters ||
|---|---|
| `v` | `View`: The view the generic motion event has been dispatched to. <br /> |
| `event` | `MotionEvent`: The MotionEvent object containing full information about the event. <br /> |

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