Stay organized with collections
Save and categorize content based on your preferences.
ActionBar.TabListener
public
static
interface
ActionBar.TabListener
android.app.ActionBar.TabListener
|
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 instead.
Callback interface invoked when a tab is focused, unfocused, added, or removed.
Summary
Public methods
onTabReselected
public abstract void onTabReselected (ActionBar.Tab tab,
FragmentTransaction ft)
Called when a tab that is already selected is chosen again by the user.
Some applications may use this action to return to the top level of a category.
Parameters |
tab |
ActionBar.Tab : The tab that was reselected. |
ft |
FragmentTransaction : A FragmentTransaction for queuing fragment operations to execute
once this method returns. This FragmentTransaction does not support
being added to the back stack. |
onTabSelected
public abstract void onTabSelected (ActionBar.Tab tab,
FragmentTransaction ft)
Called when a tab enters the selected state.
Parameters |
tab |
ActionBar.Tab : The tab that was selected |
ft |
FragmentTransaction : A FragmentTransaction for queuing fragment operations to execute
during a tab switch. The previous tab's unselect and this tab's select will be
executed in a single transaction. This FragmentTransaction does not support
being added to the back stack. |
onTabUnselected
public abstract void onTabUnselected (ActionBar.Tab tab,
FragmentTransaction ft)
Called when a tab exits the selected state.
Parameters |
tab |
ActionBar.Tab : The tab that was unselected |
ft |
FragmentTransaction : A FragmentTransaction for queuing fragment operations to execute
during a tab switch. This tab's unselect and the newly selected tab's select
will be executed in a single transaction. This FragmentTransaction does not
support being added to the back stack. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ActionBar.TabListener\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nActionBar.TabListener\n=====================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/app/ActionBar.TabListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nActionBar.TabListener\n`\n\n\n`\n\n\n`\n\n|-----------------------------------|\n| android.app.ActionBar.TabListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This interface was deprecated\nin API level 21.** \n\nAction bar navigation modes are deprecated and not supported by inline\ntoolbar action bars. Consider using other\n[common\nnavigation patterns](http://developer.android.com/design/patterns/navigation.html) instead.\n\nCallback interface invoked when a tab is focused, unfocused, added, or removed.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onTabReselected](/reference/android/app/ActionBar.TabListener#onTabReselected(android.app.ActionBar.Tab,%20android.app.FragmentTransaction))`(`[ActionBar.Tab](/reference/android/app/ActionBar.Tab)` tab, `[FragmentTransaction](/reference/android/app/FragmentTransaction)` ft) ` Called when a tab that is already selected is chosen again by the user. |\n| ` abstract void` | ` `[onTabSelected](/reference/android/app/ActionBar.TabListener#onTabSelected(android.app.ActionBar.Tab,%20android.app.FragmentTransaction))`(`[ActionBar.Tab](/reference/android/app/ActionBar.Tab)` tab, `[FragmentTransaction](/reference/android/app/FragmentTransaction)` ft) ` Called when a tab enters the selected state. |\n| ` abstract void` | ` `[onTabUnselected](/reference/android/app/ActionBar.TabListener#onTabUnselected(android.app.ActionBar.Tab,%20android.app.FragmentTransaction))`(`[ActionBar.Tab](/reference/android/app/ActionBar.Tab)` tab, `[FragmentTransaction](/reference/android/app/FragmentTransaction)` ft) ` Called when a tab exits the selected state. |\n\nPublic methods\n--------------\n\n### onTabReselected\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onTabReselected (ActionBar.Tab tab, \n FragmentTransaction ft)\n```\n\nCalled when a tab that is already selected is chosen again by the user.\nSome applications may use this action to return to the top level of a category.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `tab` | `ActionBar.Tab`: The tab that was reselected. \u003cbr /\u003e |\n| `ft` | `FragmentTransaction`: A [FragmentTransaction](/reference/android/app/FragmentTransaction) for queuing fragment operations to execute once this method returns. This FragmentTransaction does not support being added to the back stack. \u003cbr /\u003e |\n\n### onTabSelected\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onTabSelected (ActionBar.Tab tab, \n FragmentTransaction ft)\n```\n\nCalled when a tab enters the selected state.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `tab` | `ActionBar.Tab`: The tab that was selected \u003cbr /\u003e |\n| `ft` | `FragmentTransaction`: A [FragmentTransaction](/reference/android/app/FragmentTransaction) for queuing fragment operations to execute during a tab switch. The previous tab's unselect and this tab's select will be executed in a single transaction. This FragmentTransaction does not support being added to the back stack. \u003cbr /\u003e |\n\n### onTabUnselected\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onTabUnselected (ActionBar.Tab tab, \n FragmentTransaction ft)\n```\n\nCalled when a tab exits the selected state.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `tab` | `ActionBar.Tab`: The tab that was unselected \u003cbr /\u003e |\n| `ft` | `FragmentTransaction`: A [FragmentTransaction](/reference/android/app/FragmentTransaction) for queuing fragment operations to execute during a tab switch. This tab's unselect and the newly selected tab's select will be executed in a single transaction. This FragmentTransaction does not support being added to the back stack. \u003cbr /\u003e |"]]