# ActionBar.OnNavigationListener

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

# ActionBar.OnNavigationListener

*** ** * ** ***

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

`
public
static


interface
ActionBar.OnNavigationListener
`  
`


`

|--------------------------------------------|
| android.app.ActionBar.OnNavigationListener |

<br />

*** ** * ** ***

<br />

**This interface was deprecated in API level 21.**   
Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other[common navigation patterns](http://developer.android.com/design/patterns/navigation.html)instead.

Listener interface for ActionBar navigation events.

## Summary

|                                                                                                                                       ### Public methods                                                                                                                                        ||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[onNavigationItemSelected](https://developer.android.com/reference/android/app/ActionBar.OnNavigationListener#onNavigationItemSelected(int,%20long))`(int itemPosition, long itemId) ` This method is called whenever a navigation item in your action bar is selected. |

## Public methods

### onNavigationItemSelected

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

```
public abstract boolean onNavigationItemSelected (int itemPosition, 
                long itemId)
```

This method is called whenever a navigation item in your action bar is selected.

<br />

|                         Parameters                          ||
|----------------|---------------------------------------------|
| `itemPosition` | `int`: Position of the item clicked. <br /> |
| `itemId`       | `long`: ID of the item clicked. <br />      |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | True if the event was handled, false otherwise. <br /> |