# View.OnHoverListener

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

# View.OnHoverListener

*** ** * ** ***

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

`
public
static


interface
View.OnHoverListener
`  
`


`

|-----------------------------------|
| android.view.View.OnHoverListener |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                    ### Public methods                                                                                                                                                                                     ||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[onHover](https://developer.android.com/reference/android/view/View.OnHoverListener#onHover(android.view.View,%20android.view.MotionEvent))`(`[View](https://developer.android.com/reference/android/view/View)` v, `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent)` event) ` Called when a hover event is dispatched to a view. |

## Public methods

### onHover

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

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

Called when a hover 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 hover 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 /> |