# ActionBar.OnNavigationListener

Artifact: [androidx.appcompat:appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat) [View Source](https://cs.android.com/search?q=file:androidx/appcompat/app/ActionBar.java+class:androidx.appcompat.app.ActionBar.OnNavigationListener) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

*** ** * ** ***


```
interface ActionBar.OnNavigationListener
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
>
> 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 functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[onNavigationItemSelected](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnNavigationListener#onNavigationItemSelected(int,long))(itemPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, itemId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` **This function is deprecated.** Deprecated in Java |

## Public functions

### onNavigationItemSelected

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun [onNavigationItemSelected](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnNavigationListener#onNavigationItemSelected(int,long))(itemPosition: Int, itemId: Long): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

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

| Parameters |
|---|---|
| `itemPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Position of the item clicked. |
| `itemId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | ID of the item clicked. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the event was handled, false otherwise. |