ActionBar.Tab
public
static
abstract
class
ActionBar.Tab
extends Object
| java.lang.Object | |
| ↳ | android.app.ActionBar.Tab |
This class 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.
A tab in the action bar.
Tabs manage the hiding and showing of Fragments.
Summary
Constants | |
|---|---|
int |
INVALID_POSITION
An invalid position for a tab. |
Public constructors | |
|---|---|
ActionBar.Tab()
|
|
Public methods | |
|---|---|
abstract
CharSequence
|
getContentDescription()
Gets a brief description of this tab's content for use in accessibility support. |
abstract
View
|
getCustomView()
Retrieve a previously set custom view for this tab. |
abstract
Drawable
|
getIcon()
Return the icon associated with this tab. |
abstract
int
|
getPosition()
Return the current position of this tab in the action bar. |
abstract
Object
|
getTag()
|
abstract
CharSequence
|
getText()
Return the text of this tab. |
abstract
void
|
select()
Select this tab. |
abstract
ActionBar.Tab
|
setContentDescription(int resId)
Set a description of this tab's content for use in accessibility support. |
abstract
ActionBar.Tab
|
setContentDescription(CharSequence contentDesc)
Set a description of this tab's content for use in accessibility support. |
abstract
ActionBar.Tab
|
setCustomView(int layoutResId)
Set a custom view to be used for this tab. |
abstract
ActionBar.Tab
|
setCustomView(View view)
Set a custom view to be used for this tab. |
abstract
ActionBar.Tab
|
setIcon(Drawable icon)
Set the icon displayed on this tab. |
abstract
ActionBar.Tab
|
setIcon(int resId)
Set the icon displayed on this tab. |
abstract
ActionBar.Tab
|
setTabListener(ActionBar.TabListener listener)
Set the |
abstract
ActionBar.Tab
|
setTag(Object obj)
Give this Tab an arbitrary object to hold for later use. |
abstract
ActionBar.Tab
|
setText(int resId)
Set the text displayed on this tab. |
abstract
ActionBar.Tab
|
setText(CharSequence text)
Set the text displayed on this tab. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Constants
INVALID_POSITION
int INVALID_POSITION
An invalid position for a tab.
See also:
Constant Value: -1 (0xffffffff)
Public constructors
Public methods
getContentDescription
CharSequence getContentDescription ()
Gets a brief description of this tab's content for use in accessibility support.
| Returns | |
|---|---|
CharSequence |
Description of this tab's content |
getCustomView
View getCustomView ()
Retrieve a previously set custom view for this tab.
| Returns | |
|---|---|
View |
The custom view set by setCustomView(View).
|
getIcon
Drawable getIcon ()
Return the icon associated with this tab.
| Returns | |
|---|---|
Drawable |
The tab's icon |
getPosition
int getPosition ()
Return the current position of this tab in the action bar.
| Returns | |
|---|---|
int |
Current position, or INVALID_POSITION if this tab is not currently in
the action bar.
|
getText
CharSequence getText ()
Return the text of this tab.
| Returns | |
|---|---|
CharSequence |
The tab's text |
select
void select ()
Select this tab. Only valid if the tab has been added to the action bar.
setContentDescription
ActionBar.Tab setContentDescription (int resId)
Set a description of this tab's content for use in accessibility support. If no content description is provided the title will be used.
| Parameters | |
|---|---|
resId |
int: A resource ID referring to the description text |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setContentDescription
ActionBar.Tab setContentDescription (CharSequence contentDesc)
Set a description of this tab's content for use in accessibility support. If no content description is provided the title will be used.
| Parameters | |
|---|---|
contentDesc |
CharSequence: Description of this tab's content |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setCustomView
ActionBar.Tab setCustomView (int layoutResId)
Set a custom view to be used for this tab. This overrides values set by
setText(CharSequence) and setIcon(Drawable).
| Parameters | |
|---|---|
layoutResId |
int: A layout resource to inflate and use as a custom tab view |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setCustomView
ActionBar.Tab setCustomView (View view)
Set a custom view to be used for this tab. This overrides values set by
setText(CharSequence) and setIcon(Drawable).
| Parameters | |
|---|---|
view |
View: Custom view to be used as a tab. |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setIcon
ActionBar.Tab setIcon (Drawable icon)
Set the icon displayed on this tab.
| Parameters | |
|---|---|
icon |
Drawable: The drawable to use as an icon |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setIcon
ActionBar.Tab setIcon (int resId)
Set the icon displayed on this tab.
| Parameters | |
|---|---|
resId |
int: Resource ID referring to the drawable to use as an icon |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setTabListener
ActionBar.Tab setTabListener (ActionBar.TabListener listener)
Set the ActionBar.TabListener that will handle switching to and from this tab.
All tabs must have a TabListener set before being added to the ActionBar.
| Parameters | |
|---|---|
listener |
ActionBar.TabListener: Listener to handle tab selection events |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setTag
ActionBar.Tab setTag (Object obj)
Give this Tab an arbitrary object to hold for later use.
| Parameters | |
|---|---|
obj |
Object: Object to store |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setText
ActionBar.Tab setText (int resId)
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
| Parameters | |
|---|---|
resId |
int: A resource ID referring to the text that should be displayed |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
setText
ActionBar.Tab setText (CharSequence text)
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
| Parameters | |
|---|---|
text |
CharSequence: The text to display |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
Interfaces
- ActionBar.OnMenuVisibilityListener
- ActionBar.OnNavigationListener
- ActionBar.TabListener
- AlarmManager.OnAlarmListener
- Application.ActivityLifecycleCallbacks
- Application.OnProvideAssistDataListener
- AppOpsManager.OnOpChangedListener
- DatePickerDialog.OnDateSetListener
- FragmentBreadCrumbs.OnBreadCrumbClickListener
- FragmentManager.BackStackEntry
- FragmentManager.OnBackStackChangedListener
- KeyguardManager.OnKeyguardExitResult
- LoaderManager.LoaderCallbacks
- Notification.Action.Extender
- Notification.Extender
- PendingIntent.OnFinished
- SearchManager.OnCancelListener
- SearchManager.OnDismissListener
- SharedElementCallback.OnSharedElementsReadyListener
- TimePickerDialog.OnTimeSetListener
- UiAutomation.AccessibilityEventFilter
- UiAutomation.OnAccessibilityEventListener
Classes
- ActionBar
- ActionBar.LayoutParams
- ActionBar.Tab
- Activity
- ActivityGroup
- ActivityManager
- ActivityManager.AppTask
- ActivityManager.MemoryInfo
- ActivityManager.ProcessErrorStateInfo
- ActivityManager.RecentTaskInfo
- ActivityManager.RunningAppProcessInfo
- ActivityManager.RunningServiceInfo
- ActivityManager.RunningTaskInfo
- ActivityManager.TaskDescription
- ActivityOptions
- AlarmManager
- AlarmManager.AlarmClockInfo
- AlertDialog
- AlertDialog.Builder
- AliasActivity
- Application
- ApplicationErrorReport
- ApplicationErrorReport.AnrInfo
- ApplicationErrorReport.BatteryInfo
- ApplicationErrorReport.CrashInfo
- ApplicationErrorReport.RunningServiceInfo
- AppOpsManager
- AutomaticZenRule
- DatePickerDialog
- Dialog
- DialogFragment
- DownloadManager
- DownloadManager.Query
- DownloadManager.Request
- ExpandableListActivity
- Fragment
- Fragment.SavedState
- FragmentBreadCrumbs
- FragmentContainer
- FragmentController
- FragmentHostCallback
- FragmentManager
- FragmentManager.FragmentLifecycleCallbacks
- FragmentManagerNonConfig
- FragmentTransaction
- Instrumentation
- Instrumentation.ActivityMonitor
- Instrumentation.ActivityResult
- IntentService
- KeyguardManager
- KeyguardManager.KeyguardDismissCallback
- KeyguardManager.KeyguardLock
- LauncherActivity
- LauncherActivity.IconResizer
- LauncherActivity.ListItem
- ListActivity
- ListFragment
- LoaderManager
- LocalActivityManager
- MediaRouteActionProvider
- MediaRouteButton
- NativeActivity
- Notification
- Notification.Action
- Notification.Action.Builder
- Notification.Action.WearableExtender
- Notification.BigPictureStyle
- Notification.BigTextStyle
- Notification.Builder
- Notification.CarExtender
- Notification.CarExtender.Builder
- Notification.CarExtender.UnreadConversation
- Notification.DecoratedCustomViewStyle
- Notification.DecoratedMediaCustomViewStyle
- Notification.InboxStyle
- Notification.MediaStyle
- Notification.MessagingStyle
- Notification.MessagingStyle.Message
- Notification.Style
- Notification.WearableExtender
- NotificationChannel
- NotificationChannelGroup
- NotificationManager
- NotificationManager.Policy
- PendingIntent
- PictureInPictureParams
- PictureInPictureParams.Builder
- Presentation
- ProgressDialog
- RemoteAction
- RemoteInput
- RemoteInput.Builder
- SearchableInfo
- SearchManager
- Service
- SharedElementCallback
- TabActivity
- TaskStackBuilder
- TimePickerDialog
- UiAutomation
- UiModeManager
- VoiceInteractor
- VoiceInteractor.AbortVoiceRequest
- VoiceInteractor.CommandRequest
- VoiceInteractor.CompleteVoiceRequest
- VoiceInteractor.ConfirmationRequest
- VoiceInteractor.PickOptionRequest
- VoiceInteractor.PickOptionRequest.Option
- VoiceInteractor.Prompt
- VoiceInteractor.Request
- WallpaperInfo
- WallpaperManager
Exceptions