# ActionBar

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) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

*** ** * ** ***


```
abstract class ActionBar
```

<br />

*** ** * ** ***

A primary toolbar within the activity that may display the activity title, application-level navigation affordances, and other interactive items.

The action bar appears at the top of an activity's window when the activity uses the AppCompat's `https://developer.android.com/reference/kotlin/androidx/appcompat/R.style#Theme_AppCompat()` theme (or one of its descendant themes). You may otherwise add the action bar by calling `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDelegate#requestWindowFeature(int)` or by declaring it in a custom theme with the windowActionBar property.

The action bar may be represented by any Toolbar widget within the application layout. The application may signal to the Activity which Toolbar should be treated as the Activity's action bar. Activities that use this feature should use one of the supplied `.NoActionBar` themes, set the windowActionBar attribute to `false` or otherwise not request the window feature.

If your activity has an options menu, you can make select items accessible directly from the action bar as "action items". You can also modify various characteristics of the action bar or remove it completely.

The navigation button (formerly "Home") takes over the space previously occupied by the application icon. Apps wishing to express a stronger branding should use their brand colors heavily in the action bar and other application chrome or use a `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setLogo(int)` in place of their standard title text.

From your activity, you can retrieve an instance of `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar` by calling `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity#getSupportActionBar()` getSupportActionBar()}.

In some cases, the action bar may be overlayed by another bar that enables contextual actions, using an `https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode`. For example, when the user selects one or more items in your activity, you can enable an action mode that offers actions specific to the selected items, with a UI that temporarily replaces the action bar. Although the UI may occupy the same space, the `https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode` APIs are distinct and independent from those for `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar`.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams : https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html` Per-child layout information associated with action bar custom views. |
| `interface https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnMenuVisibilityListener` Listener for receiving events when action bar menus are shown or hidden. |
| `interface https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnNavigationListener` **This interface is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract class https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab` **This class is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `interface https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.TabListener` **This interface is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP() = 4` Display the 'home' element such that it appears as an 'up' affordance. e.g. show an arrow to the left indicating the action that will be taken. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_CUSTOM() = 16` Show the custom view if one has been set. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_HOME() = 2` Show 'home' elements in this action bar, leaving more space for other navigation elements. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_TITLE() = 8` Show the activity title and subtitle, if present. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_USE_LOGO() = 1` Use logo instead of icon if available. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_LIST() = 1` **This property is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_STANDARD() = 0` **This property is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_TABS() = 2` **This property is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#ActionBar()()` |

| ### Public functions |
|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addOnMenuVisibilityListener(androidx.appcompat.app.ActionBar.OnMenuVisibilityListener)( listener: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnMenuVisibilityListener! )` Add a listener that will respond to menu visibility change events. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab))(tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab,int))(tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab,boolean))(tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!, setSelected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab,int,boolean))(tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, setSelected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://developer.android.com/reference/android/view/View.html!` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getCustomView()()` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getDisplayOptions()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getElevation()()` Get the Z-axis elevation of the action bar in pixels. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getHeight()()` Retrieve the current height of the ActionBar. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getHideOffset()()` Return the current vertical offset of the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getNavigationItemCount](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getNavigationItemCount())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getNavigationMode](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getNavigationMode())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getSelectedNavigationIndex](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getSelectedNavigationIndex())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab?` | `[getSelectedTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getSelectedTab())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getSubtitle()()` Returns the current ActionBar subtitle in standard mode. |
| `abstract https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | `[getTabAt](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getTabAt(int))(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getTabCount](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getTabCount())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `https://developer.android.com/reference/android/content/Context.html!` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getThemedContext()()` Returns a `https://developer.android.com/reference/android/content/Context.html` with an appropriate theme for creating views that will appear in the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getTitle()()` Returns the current ActionBar title in standard mode. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#hide()()` Hide the ActionBar if it is currently showing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#isHideOnContentScrollEnabled()()` Return whether the action bar is configured to scroll out of sight along with a `https://developer.android.com/reference/android/view/View.html#setNestedScrollingEnabled(boolean)`. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#isShowing()()` |
| `abstract https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | `[newTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#newTab())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removeAllTabs](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeAllTabs())()` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeOnMenuVisibilityListener(androidx.appcompat.app.ActionBar.OnMenuVisibilityListener)( listener: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnMenuVisibilityListener! )` Remove a menu visibility listener. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removeTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeTab(androidx.appcompat.app.ActionBar.Tab))(tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removeTabAt](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeTabAt(int))(position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[selectTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#selectTab(androidx.appcompat.app.ActionBar.Tab))(tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setBackgroundDrawable(android.graphics.drawable.Drawable)(d: https://developer.android.com/reference/android/graphics/drawable/Drawable.html?)` Set the ActionBar's background. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setCustomView(int)(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the action bar into custom navigation mode, supplying a view for custom navigation. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setCustomView(android.view.View)(view: https://developer.android.com/reference/android/view/View.html!)` Set the action bar into custom navigation mode, supplying a view for custom navigation. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setCustomView(android.view.View,androidx.appcompat.app.ActionBar.LayoutParams)(view: https://developer.android.com/reference/android/view/View.html!, layoutParams: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams!)` Set the action bar into custom navigation mode, supplying a view for custom navigation. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayHomeAsUpEnabled(boolean)(showHomeAsUp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Set whether home should be displayed as an "up" affordance. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)(options: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set display options. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)(options: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, mask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set selected display options. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowCustomEnabled(boolean)(showCustom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Set whether a custom view should be displayed, if set. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowHomeEnabled(boolean)(showHome: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Set whether to include the application home affordance in the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowTitleEnabled(boolean)(showTitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Set whether an activity title/subtitle should be displayed. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayUseLogoEnabled(boolean)(useLogo: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Set whether to display the activity logo rather than the activity icon. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setElevation(float)(elevation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Set the Z-axis elevation of the action bar in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHideOffset(int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the current hide offset of the action bar. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHideOnContentScrollEnabled(boolean)(hideOnContentScroll: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Enable hiding the action bar on content scroll. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeActionContentDescription(java.lang.CharSequence)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)` Set an alternate description for the Home/Up action, when enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeActionContentDescription(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set an alternate description for the Home/Up action, when enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(android.graphics.drawable.Drawable)(indicator: https://developer.android.com/reference/android/graphics/drawable/Drawable.html?)` Set an alternate drawable to display next to the icon/logo/title when `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` is enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set an alternate drawable to display next to the icon/logo/title when `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` is enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeButtonEnabled(boolean)(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Enable or disable the "home" button in the corner of the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setIcon(android.graphics.drawable.Drawable)(icon: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!)` Set the icon to display in the 'home' section of the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setIcon(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the icon to display in the 'home' section of the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setListNavigationCallbacks](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setListNavigationCallbacks(android.widget.SpinnerAdapter,androidx.appcompat.app.ActionBar.OnNavigationListener))( adapter: https://developer.android.com/reference/android/widget/SpinnerAdapter.html!, callback: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnNavigationListener! )` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setLogo(android.graphics.drawable.Drawable)(logo: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!)` Set the logo to display in the 'home' section of the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setLogo(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the logo to display in the 'home' section of the action bar. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setNavigationMode](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setNavigationMode(int))(mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setSelectedNavigationItem](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSelectedNavigationItem(int))(position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Action bar navigation modes are deprecated and not supported by inline toolbar action bars. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSplitBackgroundDrawable(android.graphics.drawable.Drawable)(d: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!)` Set the ActionBar's split background. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setStackedBackgroundDrawable(android.graphics.drawable.Drawable)(d: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!)` Set the ActionBar's stacked background. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSubtitle(int)(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the action bar's subtitle. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSubtitle(java.lang.CharSequence)(subtitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!)` Set the action bar's subtitle. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setTitle(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the action bar's title. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setTitle(java.lang.CharSequence)(title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!)` Set the action bar's title. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#show()()` Show the ActionBar if it is not currently showing. |

## Constants

### DISPLAY_HOME_AS_UP

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

```
const val DISPLAY_HOME_AS_UP = 4: Int
```

Display the 'home' element such that it appears as an 'up' affordance. e.g. show an arrow to the left indicating the action that will be taken. Set this flag if selecting the 'home' button in the action bar to return up by a single level in your UI rather than back to the top level or front page.

Setting this option will implicitly enable interaction with the home/up button. See `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeButtonEnabled(boolean)`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### DISPLAY_SHOW_CUSTOM

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

```
const val DISPLAY_SHOW_CUSTOM = 16: Int
```

Show the custom view if one has been set.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setCustomView(android.view.View)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### DISPLAY_SHOW_HOME

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

```
const val DISPLAY_SHOW_HOME = 2: Int
```

Show 'home' elements in this action bar, leaving more space for other navigation elements. This includes logo and icon.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### DISPLAY_SHOW_TITLE

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

```
const val DISPLAY_SHOW_TITLE = 8: Int
```

Show the activity title and subtitle, if present.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setTitle(java.lang.CharSequence)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setTitle(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSubtitle(java.lang.CharSequence)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSubtitle(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### DISPLAY_USE_LOGO

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

```
const val DISPLAY_USE_LOGO = 1: Int
```

Use logo instead of icon if available. This flag will cause appropriate navigation modes to use a wider logo in place of the standard icon.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### NAVIGATION_MODE_LIST

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)

```
const val NAVIGATION_MODE_LIST = 1: Int
```

> [!CAUTION]
> **This property 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.

List navigation mode. Instead of static title text this mode presents a list menu for navigation within the activity. e.g. this might be presented to the user as a dropdown list.

### NAVIGATION_MODE_STANDARD

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)

```
const val NAVIGATION_MODE_STANDARD = 0: Int
```

> [!CAUTION]
> **This property 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.

Standard navigation mode. Consists of either a logo or icon and title text with an optional subtitle. Clicking any of these elements will dispatch onOptionsItemSelected to the host Activity with a MenuItem with item ID android.R.id.home.

### NAVIGATION_MODE_TABS

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)

```
const val NAVIGATION_MODE_TABS = 2: Int
```

> [!CAUTION]
> **This property 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.

Tab navigation mode. Instead of static title text this mode presents a series of tabs for navigation within the activity.

## Public constructors

### ActionBar

Added in 1.1.0

```
ActionBar()
```

## Public functions

### addOnMenuVisibilityListener

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

```
abstract fun addOnMenuVisibilityListener(
    listener: ActionBar.OnMenuVisibilityListener!
): Unit
```

Add a listener that will respond to menu visibility change events.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnMenuVisibilityListener!` | The new listener to add |

### addTab

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)

```
abstract fun [addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab))(tab: ActionBar.Tab!): Unit
```

> [!CAUTION]
> **This function 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.

Add a tab for use in tabbed navigation mode. The tab will be added at the end of the list. If this is the first tab to be added it will become the selected tab.

| Parameters |
|---|---|
| `tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | Tab to add |

### addTab

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)

```
abstract fun [addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab,int))(tab: ActionBar.Tab!, position: Int): Unit
```

> [!CAUTION]
> **This function 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.

Add a tab for use in tabbed navigation mode. The tab will be inserted at `position`. If this is the first tab to be added it will become the selected tab.

| Parameters |
|---|---|
| `tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | The tab to add |
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The new position of the tab |

### addTab

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)

```
abstract fun [addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab,boolean))(tab: ActionBar.Tab!, setSelected: Boolean): Unit
```

> [!CAUTION]
> **This function 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.

Add a tab for use in tabbed navigation mode. The tab will be added at the end of the list.

| Parameters |
|---|---|
| `tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | Tab to add |
| `setSelected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the added tab should become the selected tab. |

### addTab

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)

```
abstract fun [addTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab,int,boolean))(tab: ActionBar.Tab!, position: Int, setSelected: Boolean): Unit
```

> [!CAUTION]
> **This function 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.

Add a tab for use in tabbed navigation mode. The tab will be inserted at `position`.

| Parameters |
|---|---|
| `tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | The tab to add |
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The new position of the tab |
| `setSelected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the added tab should become the selected tab. |

### getCustomView

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

```
abstract fun getCustomView(): View!
```

| Returns |
|---|---|
| `https://developer.android.com/reference/android/view/View.html!` | The current custom view. |

### getDisplayOptions

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

```
abstract fun getDisplayOptions(): Int
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The current set of display options. |

### getElevation

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

```
fun getElevation(): Float
```

Get the Z-axis elevation of the action bar in pixels.

The action bar's elevation is the distance it is placed from its parent surface. Higher values are closer to the user.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Elevation value in pixels |

### getHeight

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

```
abstract fun getHeight(): Int
```

Retrieve the current height of the ActionBar.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The ActionBar's height |

### getHideOffset

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

```
fun getHideOffset(): Int
```

Return the current vertical offset of the action bar.

The action bar's current hide offset is the distance that the action bar is currently scrolled offscreen in pixels. The valid range is 0 (fully visible) to the action bar's current measured `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getHeight()` (fully invisible).

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The action bar's offset toward its fully hidden state in pixels |

### getNavigationItemCount

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)

```
abstract fun [getNavigationItemCount](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getNavigationItemCount())(): Int
```

> [!CAUTION]
> **This function 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.

Get the number of navigation items present in the current navigation mode.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Number of navigation items. |

### getNavigationMode

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)

```
abstract fun [getNavigationMode](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getNavigationMode())(): Int
```

> [!CAUTION]
> **This function 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.

Returns the current navigation mode. The result will be one of:

- `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_STANDARD()`
- `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_LIST()`
- `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_TABS()`

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The current navigation mode. |

### getSelectedNavigationIndex

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)

```
abstract fun [getSelectedNavigationIndex](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getSelectedNavigationIndex())(): Int
```

> [!CAUTION]
> **This function 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.

Get the position of the selected navigation item in list or tabbed navigation modes.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Position of the selected item. |

### getSelectedTab

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)

```
abstract fun [getSelectedTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getSelectedTab())(): ActionBar.Tab?
```

> [!CAUTION]
> **This function 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.

Returns the currently selected tab if in tabbed navigation mode and there is at least one tab present.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab?` | The currently selected tab or null |

### getSubtitle

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

```
abstract fun getSubtitle(): CharSequence?
```

Returns the current ActionBar subtitle in standard mode. Returns null if `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getNavigationMode()` would not return `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_STANDARD()`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | The current ActionBar subtitle or null. |

### getTabAt

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)

```
abstract fun [getTabAt](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getTabAt(int))(index: Int): ActionBar.Tab!
```

> [!CAUTION]
> **This function 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.

Returns the tab at the specified index.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Index value in the range 0-get |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` |   |

### getTabCount

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)

```
abstract fun [getTabCount](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getTabCount())(): Int
```

> [!CAUTION]
> **This function 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.

Returns the number of tabs currently registered with the action bar.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Tab count |

### getThemedContext

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

```
fun getThemedContext(): Context!
```

Returns a `https://developer.android.com/reference/android/content/Context.html` with an appropriate theme for creating views that will appear in the action bar. If you are inflating or instantiating custom views that will appear in an action bar, you should use the Context returned by this method. (This includes adapters used for list navigation mode.) This will ensure that views contrast properly against the action bar.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html!` | A themed Context for creating views |

### getTitle

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

```
abstract fun getTitle(): CharSequence?
```

Returns the current ActionBar title in standard mode. Returns null if `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getNavigationMode()` would not return `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_STANDARD()`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | The current ActionBar title or null. |

### hide

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

```
abstract fun hide(): Unit
```

Hide the ActionBar if it is currently showing. If the window hosting the ActionBar does not have the feature `https://developer.android.com/reference/android/view/Window.html#FEATURE_ACTION_BAR_OVERLAY` it will resize application content to fit the new space available.

Instead of calling this function directly, you can also cause an ActionBar using the overlay feature to hide through `https://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_FULLSCREEN`. Hiding the ActionBar through this system UI flag allows you to more seamlessly hide it in conjunction with other screen decorations.

### isHideOnContentScrollEnabled

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

```
fun isHideOnContentScrollEnabled(): Boolean
```

Return whether the action bar is configured to scroll out of sight along with a `https://developer.android.com/reference/android/view/View.html#setNestedScrollingEnabled(boolean)`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if hide-on-content-scroll is enabled |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHideOnContentScrollEnabled(boolean)` |   |

### isShowing

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

```
abstract fun isShowing(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the ActionBar is showing, `false` otherwise. |

### newTab

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)

```
abstract fun [newTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#newTab())(): ActionBar.Tab!
```

> [!CAUTION]
> **This function 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.

Create and return a new `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab`. This tab will not be included in the action bar until it is added.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | A new Tab |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#addTab(androidx.appcompat.app.ActionBar.Tab)` |   |

### removeAllTabs

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)

```
abstract fun [removeAllTabs](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeAllTabs())(): Unit
```

> [!CAUTION]
> **This function 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.

Remove all tabs from the action bar and deselect the current tab.

### removeOnMenuVisibilityListener

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

```
abstract fun removeOnMenuVisibilityListener(
    listener: ActionBar.OnMenuVisibilityListener!
): Unit
```

Remove a menu visibility listener. This listener will no longer receive menu visibility change events.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnMenuVisibilityListener!` | A listener to remove that was previously added |

### removeTab

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)

```
abstract fun [removeTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeTab(androidx.appcompat.app.ActionBar.Tab))(tab: ActionBar.Tab!): Unit
```

> [!CAUTION]
> **This function 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.

Remove a tab from the action bar. If the removed tab was selected it will be deselected and another tab will be selected if present.

| Parameters |
|---|---|
| `tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | The tab to remove |

### removeTabAt

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)

```
abstract fun [removeTabAt](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#removeTabAt(int))(position: Int): Unit
```

> [!CAUTION]
> **This function 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.

Remove a tab from the action bar. If the removed tab was selected it will be deselected and another tab will be selected if present.

| Parameters |
|---|---|
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Position of the tab to remove |

### selectTab

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)

```
abstract fun [selectTab](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#selectTab(androidx.appcompat.app.ActionBar.Tab))(tab: ActionBar.Tab!): Unit
```

> [!CAUTION]
> **This function 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.

Select the specified tab. If it is not a child of this action bar it will be added.

Note: If you want to select by index, use `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSelectedNavigationItem(int)`.

| Parameters |
|---|---|
| `tab: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.Tab!` | Tab to select |

### setBackgroundDrawable

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

```
abstract fun setBackgroundDrawable(d: Drawable?): Unit
```

Set the ActionBar's background. This will be used for the primary action bar.

| Parameters |
|---|---|
| `d: https://developer.android.com/reference/android/graphics/drawable/Drawable.html?` | Background drawable |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setStackedBackgroundDrawable(android.graphics.drawable.Drawable)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSplitBackgroundDrawable(android.graphics.drawable.Drawable)` |   |

### setCustomView

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

```
abstract fun setCustomView(resId: Int): Unit
```

Set the action bar into custom navigation mode, supplying a view for custom navigation.

Custom navigation views appear between the application icon and any action buttons and may use any space available there. Common use cases for custom navigation views might include an auto-suggesting address bar for a browser or other navigation mechanisms that do not translate well to provided navigation modes.

The display option `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_CUSTOM()` must be set for the custom view to be displayed.

| Parameters |
|---|---|
| `resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of a layout to inflate into the ActionBar. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setCustomView

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

```
abstract fun setCustomView(view: View!): Unit
```

Set the action bar into custom navigation mode, supplying a view for custom navigation. Custom navigation views appear between the application icon and any action buttons and may use any space available there. Common use cases for custom navigation views might include an auto-suggesting address bar for a browser or other navigation mechanisms that do not translate well to provided navigation modes.

| Parameters |
|---|---|
| `view: https://developer.android.com/reference/android/view/View.html!` | Custom navigation view to place in the ActionBar. |

### setCustomView

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

```
abstract fun setCustomView(view: View!, layoutParams: ActionBar.LayoutParams!): Unit
```

Set the action bar into custom navigation mode, supplying a view for custom navigation.

Custom navigation views appear between the application icon and any action buttons and may use any space available there. Common use cases for custom navigation views might include an auto-suggesting address bar for a browser or other navigation mechanisms that do not translate well to provided navigation modes.

The display option `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_CUSTOM()` must be set for the custom view to be displayed.

| Parameters |
|---|---|
| `view: https://developer.android.com/reference/android/view/View.html!` | Custom navigation view to place in the ActionBar. |
| `layoutParams: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams!` | How this custom view should layout in the bar. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setDisplayHomeAsUpEnabled

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

```
abstract fun setDisplayHomeAsUpEnabled(showHomeAsUp: Boolean): Unit
```

Set whether home should be displayed as an "up" affordance. Set this to true if selecting "home" returns up by a single level in your UI rather than back to the top level or front page.

To set several display options at once, see the setDisplayOptions methods.

| Parameters |
|---|---|
| `showHomeAsUp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to show the user that selecting home will return one level up rather than to the top level of the app. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setDisplayOptions

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

```
abstract fun setDisplayOptions(options: Int): Unit
```

Set display options. This changes all display option bits at once. To change a limited subset of display options, see `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)`.

| Parameters |
|---|---|
| `options: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A combination of the bits defined by the DISPLAY_ constants defined in ActionBar. |

### setDisplayOptions

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

```
abstract fun setDisplayOptions(options: Int, mask: Int): Unit
```

Set selected display options. Only the options specified by mask will be changed. To change all display option bits at once, see `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)`.

Example: setDisplayOptions(0, DISPLAY_SHOW_HOME) will disable the `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_HOME()` option. setDisplayOptions(DISPLAY_SHOW_HOME, DISPLAY_SHOW_HOME \| DISPLAY_USE_LOGO) will enable `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_HOME()` and disable `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_USE_LOGO()`.

| Parameters |
|---|---|
| `options: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A combination of the bits defined by the DISPLAY_ constants defined in ActionBar. |
| `mask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A bit mask declaring which display options should be changed. |

### setDisplayShowCustomEnabled

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

```
abstract fun setDisplayShowCustomEnabled(showCustom: Boolean): Unit
```

Set whether a custom view should be displayed, if set.

To set several display options at once, see the setDisplayOptions methods.

| Parameters |
|---|---|
| `showCustom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the currently set custom view should be displayed, false otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setDisplayShowHomeEnabled

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

```
abstract fun setDisplayShowHomeEnabled(showHome: Boolean): Unit
```

Set whether to include the application home affordance in the action bar. Home is presented as either an activity icon or logo.

To set several display options at once, see the setDisplayOptions methods.

| Parameters |
|---|---|
| `showHome: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to show home, false otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setDisplayShowTitleEnabled

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

```
abstract fun setDisplayShowTitleEnabled(showTitle: Boolean): Unit
```

Set whether an activity title/subtitle should be displayed.

To set several display options at once, see the setDisplayOptions methods.

| Parameters |
|---|---|
| `showTitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to display a title/subtitle if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setDisplayUseLogoEnabled

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

```
abstract fun setDisplayUseLogoEnabled(useLogo: Boolean): Unit
```

Set whether to display the activity logo rather than the activity icon. A logo is often a wider, more detailed image.

To set several display options at once, see the setDisplayOptions methods.

| Parameters |
|---|---|
| `useLogo: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to use the activity logo, false to use the activity icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setElevation

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

```
fun setElevation(elevation: Float): Unit
```

Set the Z-axis elevation of the action bar in pixels.

The action bar's elevation is the distance it is placed from its parent surface. Higher values are closer to the user.

| Parameters |
|---|---|
| `elevation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Elevation value in pixels |

### setHideOffset

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

```
fun setHideOffset(offset: Int): Unit
```

Set the current hide offset of the action bar.

The action bar's current hide offset is the distance that the action bar is currently scrolled offscreen in pixels. The valid range is 0 (fully visible) to the action bar's current measured `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#getHeight()` (fully invisible).

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The action bar's offset toward its fully hidden state in pixels. |

### setHideOnContentScrollEnabled

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

```
fun setHideOnContentScrollEnabled(hideOnContentScroll: Boolean): Unit
```

Enable hiding the action bar on content scroll.

If enabled, the action bar will scroll out of sight along with a `https://developer.android.com/reference/android/view/View.html#setNestedScrollingEnabled(boolean)` view's content. The action bar must be in `https://developer.android.com/reference/android/view/Window.html#FEATURE_ACTION_BAR_OVERLAY` to enable hiding on content scroll.

When partially scrolled off screen the action bar is considered `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#hide()`. A call to `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#show()` will cause it to return to full view.

| Parameters |
|---|---|
| `hideOnContentScroll: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to enable hiding on content scroll. |

### setHomeActionContentDescription

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

```
fun setHomeActionContentDescription(description: CharSequence?): Unit
```

Set an alternate description for the Home/Up action, when enabled.

This description is commonly used for accessibility/screen readers when the Home action is enabled. (See `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayHomeAsUpEnabled(boolean)`.) Examples of this are, "Navigate Home" or "Navigate Up" depending on the `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` display option. If you have changed the home-as-up indicator using `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(int)` to indicate more specific functionality such as a sliding drawer, you should also set this to accurately describe the action.

Setting this to `null` will use the system default description.

| Parameters |
|---|---|
| `description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | New description for the Home action when enabled |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(android.graphics.drawable.Drawable)` |   |

### setHomeActionContentDescription

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

```
fun setHomeActionContentDescription(resId: @StringRes Int): Unit
```

Set an alternate description for the Home/Up action, when enabled.

This description is commonly used for accessibility/screen readers when the Home action is enabled. (See `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayHomeAsUpEnabled(boolean)`.) Examples of this are, "Navigate Home" or "Navigate Up" depending on the `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` display option. If you have changed the home-as-up indicator using `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(int)` to indicate more specific functionality such as a sliding drawer, you should also set this to accurately describe the action.

Setting this to `0` will use the system default description.

| Parameters |
|---|---|
| `resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of a string to use as the new description for the Home action when enabled |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeAsUpIndicator(android.graphics.drawable.Drawable)` |   |

### setHomeAsUpIndicator

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

```
fun setHomeAsUpIndicator(indicator: Drawable?): Unit
```

Set an alternate drawable to display next to the icon/logo/title when `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` is enabled. This can be useful if you are using this mode to display an alternate selection for up navigation, such as a sliding drawer.

If you pass `null` to this method, the default drawable from the theme will be used.

If you implement alternate or intermediate behavior around Up, you should also call `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeActionContentDescription(int)` to provide a correct description of the action for accessibility support.

| Parameters |
|---|---|
| `indicator: https://developer.android.com/reference/android/graphics/drawable/Drawable.html?` | A drawable to use for the up indicator, or null to use the theme's default |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayHomeAsUpEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeActionContentDescription(int)` |   |

### setHomeAsUpIndicator

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

```
fun setHomeAsUpIndicator(resId: @DrawableRes Int): Unit
```

Set an alternate drawable to display next to the icon/logo/title when `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` is enabled. This can be useful if you are using this mode to display an alternate selection for up navigation, such as a sliding drawer.

If you pass `0` to this method, the default drawable from the theme will be used.

If you implement alternate or intermediate behavior around Up, you should also call `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeActionContentDescription(int)` to provide a correct description of the action for accessibility support.

| Parameters |
|---|---|
| `resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of a drawable to use for the up indicator, or null to use the theme's default |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayHomeAsUpEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setHomeActionContentDescription(int)` |   |

### setHomeButtonEnabled

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

```
fun setHomeButtonEnabled(enabled: Boolean): Unit
```

Enable or disable the "home" button in the corner of the action bar. (Note that this is the application home/up affordance on the action bar, not the system wide home button.)

The application should call this method to enable interaction with the home/up affordance.

Setting the `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_HOME_AS_UP()` display option will automatically enable the home button.

| Parameters |
|---|---|
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to enable the home button, false to disable the home button. |

### setIcon

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

```
abstract fun setIcon(icon: Drawable!): Unit
```

Set the icon to display in the 'home' section of the action bar. The action bar will use an icon specified by its style or the activity icon by default. Whether the home section shows an icon or logo is controlled by the display option `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_USE_LOGO()`.

| Parameters |
|---|---|
| `icon: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` | Drawable to show as an icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayUseLogoEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowHomeEnabled(boolean)` |   |

### setIcon

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

```
abstract fun setIcon(resId: @DrawableRes Int): Unit
```

Set the icon to display in the 'home' section of the action bar. The action bar will use an icon specified by its style or the activity icon by default. Whether the home section shows an icon or logo is controlled by the display option `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_USE_LOGO()`.

| Parameters |
|---|---|
| `resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of a drawable to show as an icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayUseLogoEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowHomeEnabled(boolean)` |   |

### setListNavigationCallbacks

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)

```
abstract fun [setListNavigationCallbacks](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setListNavigationCallbacks(android.widget.SpinnerAdapter,androidx.appcompat.app.ActionBar.OnNavigationListener))(
    adapter: SpinnerAdapter!,
    callback: ActionBar.OnNavigationListener!
): Unit
```

> [!CAUTION]
> **This function 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.

Set the adapter and navigation callback for list navigation mode. The supplied adapter will provide views for the expanded list as well as the currently selected item. (These may be displayed differently.) The supplied OnNavigationListener will alert the application when the user changes the current list selection.

| Parameters |
|---|---|
| `adapter: https://developer.android.com/reference/android/widget/SpinnerAdapter.html!` | An adapter that will provide views both to display the current navigation selection and populate views within the dropdown navigation menu. |
| `callback: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.OnNavigationListener!` | An OnNavigationListener that will receive events when the user selects a navigation item. |

### setLogo

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

```
abstract fun setLogo(logo: Drawable!): Unit
```

Set the logo to display in the 'home' section of the action bar. The action bar will use a logo specified by its style or the activity logo by default. Whether the home section shows an icon or logo is controlled by the display option `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_USE_LOGO()`.

| Parameters |
|---|---|
| `logo: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` | Drawable to show as a logo. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayUseLogoEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowHomeEnabled(boolean)` |   |

### setLogo

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

```
abstract fun setLogo(resId: @DrawableRes Int): Unit
```

Set the logo to display in the 'home' section of the action bar. The action bar will use a logo specified by its style or the activity logo by default. Whether the home section shows an icon or logo is controlled by the display option `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_USE_LOGO()`.

| Parameters |
|---|---|
| `resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of a drawable to show as a logo. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayUseLogoEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayShowHomeEnabled(boolean)` |   |

### setNavigationMode

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)

```
abstract fun [setNavigationMode](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setNavigationMode(int))(mode: Int): Unit
```

> [!CAUTION]
> **This function 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.

Set the current navigation mode.

| Parameters |
|---|---|
| `mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The new mode to set. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_STANDARD()` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_LIST()` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#NAVIGATION_MODE_TABS()` |   |

### setSelectedNavigationItem

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)

```
abstract fun [setSelectedNavigationItem](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSelectedNavigationItem(int))(position: Int): Unit
```

> [!CAUTION]
> **This function 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.

Set the selected navigation item in list or tabbed navigation modes.

| Parameters |
|---|---|
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Position of the item to select. |

### setSplitBackgroundDrawable

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

```
fun setSplitBackgroundDrawable(d: Drawable!): Unit
```

Set the ActionBar's split background. This will appear in the split action bar containing menu-provided action buttons on some devices and configurations.

You can enable split action bar with `https://developer.android.com/reference/android/R.attr.html#uiOptions`

| Parameters |
|---|---|
| `d: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` | Background drawable for the split bar |

### setStackedBackgroundDrawable

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

```
fun setStackedBackgroundDrawable(d: Drawable!): Unit
```

Set the ActionBar's stacked background. This will appear in the second row/stacked bar on some devices and configurations.

| Parameters |
|---|---|
| `d: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` | Background drawable for the stacked row |

### setSubtitle

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

```
abstract fun setSubtitle(resId: Int): Unit
```

Set the action bar's subtitle. This will only be displayed if `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_TITLE()` is set.

| Parameters |
|---|---|
| `resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of subtitle string to set |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSubtitle(java.lang.CharSequence)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setSubtitle

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

```
abstract fun setSubtitle(subtitle: CharSequence!): Unit
```

Set the action bar's subtitle. This will only be displayed if `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_TITLE()` is set. Set to null to disable the subtitle entirely.

| Parameters |
|---|---|
| `subtitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | Subtitle to set |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setSubtitle(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setTitle

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

```
abstract fun setTitle(resId: @StringRes Int): Unit
```

Set the action bar's title. This will only be displayed if `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_TITLE()` is set.

| Parameters |
|---|---|
| `resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of title string to set |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setTitle(java.lang.CharSequence)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### setTitle

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

```
abstract fun setTitle(title: CharSequence!): Unit
```

Set the action bar's title. This will only be displayed if `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#DISPLAY_SHOW_TITLE()` is set.

| Parameters |
|---|---|
| `title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | Title to set |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setTitle(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar#setDisplayOptions(int,int)` |   |

### show

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

```
abstract fun show(): Unit
```

Show the ActionBar if it is not currently showing. If the window hosting the ActionBar does not have the feature `https://developer.android.com/reference/android/view/Window.html#FEATURE_ACTION_BAR_OVERLAY` it will resize application content to fit the new space available.

If you are hiding the ActionBar through `https://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_FULLSCREEN`, you should not call this function directly.