public abstract static class ActionBar.Tab extends Object
Tabs manage the hiding and showing of Fragments.
| Modifier and Type | Field and Description | 
|---|---|
static int | 
INVALID_POSITION
An invalid position for a tab. 
 | 
| Constructor and Description | 
|---|
Tab()  | 
| Modifier and Type | Method and Description | 
|---|---|
abstract CharSequence | 
getContentDescription()
Gets a brief description of this tab's content for use in accessibility support. 
 | 
abstract android.view.View | 
getCustomView()
Retrieve a previously set custom view for this tab. 
 | 
abstract android.graphics.drawable.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(CharSequence contentDesc)
Set a description of this tab's content for use in accessibility support. 
 | 
abstract ActionBar.Tab | 
setContentDescription(int resId)
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(android.view.View view)
Set a custom view to be used for this tab. 
 | 
abstract ActionBar.Tab | 
setIcon(android.graphics.drawable.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  
ActionBar.TabListener that will handle switching to and from this tab. | 
abstract ActionBar.Tab | 
setTag(Object obj)
Give this Tab an arbitrary object to hold for later use. 
 | 
abstract ActionBar.Tab | 
setText(CharSequence text)
Set the text displayed on this tab. 
 | 
abstract ActionBar.Tab | 
setText(int resId)
Set the text displayed on this tab. 
 | 
public static final int INVALID_POSITION
getPosition(), 
Constant Field Valuespublic abstract int getPosition()
INVALID_POSITION if this tab is not currently in
         the action bar.public abstract android.graphics.drawable.Drawable getIcon()
public abstract CharSequence getText()
public abstract ActionBar.Tab setIcon(android.graphics.drawable.Drawable icon)
icon - The drawable to use as an iconpublic abstract ActionBar.Tab setIcon(int resId)
resId - Resource ID referring to the drawable to use as an iconpublic abstract ActionBar.Tab setText(CharSequence text)
text - The text to displaypublic abstract ActionBar.Tab setText(int resId)
resId - A resource ID referring to the text that should be displayedpublic abstract ActionBar.Tab setCustomView(android.view.View view)
setText(CharSequence) and setIcon(Drawable).view - Custom view to be used as a tab.public abstract ActionBar.Tab setCustomView(int layoutResId)
setText(CharSequence) and setIcon(Drawable).layoutResId - A layout resource to inflate and use as a custom tab viewpublic abstract android.view.View getCustomView()
setCustomView(View).public abstract ActionBar.Tab setTag(Object obj)
obj - Object to storepublic abstract Object getTag()
public abstract ActionBar.Tab setTabListener(ActionBar.TabListener listener)
ActionBar.TabListener that will handle switching to and from this tab.
 All tabs must have a TabListener set before being added to the ActionBar.listener - Listener to handle tab selection eventspublic abstract void select()
public abstract ActionBar.Tab setContentDescription(int resId)
resId - A resource ID referring to the description textsetContentDescription(CharSequence), 
getContentDescription()public abstract ActionBar.Tab setContentDescription(CharSequence contentDesc)
contentDesc - Description of this tab's contentsetContentDescription(int), 
getContentDescription()public abstract CharSequence getContentDescription()
setContentDescription(CharSequence), 
setContentDescription(int)Copyright © 2011–2014. All rights reserved.