Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/ActionBar.Tab#constants) \| [Ctors](https://developer.android.com/reference/android/app/ActionBar.Tab#pubctors) \| [Methods](https://developer.android.com/reference/android/app/ActionBar.Tab#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/ActionBar.Tab#inhmethods)

# ActionBar.Tab

*** ** * ** ***

` public static abstract class ActionBar.Tab `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.ActionBar.Tab |

<br />

*** ** * ** ***

<br />

**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](http://developer.android.com/design/patterns/navigation.html) instead.

A tab in the action bar.

Tabs manage the hiding and showing of `https://developer.android.com/reference/android/app/Fragment`s.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/app/ActionBar.Tab#INVALID_POSITION` An invalid position for a tab. |

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

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#getContentDescription()() ` Gets a brief description of this tab's content for use in accessibility support. |
| ` abstract https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#getCustomView()() ` Retrieve a previously set custom view for this tab. |
| ` abstract https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#getIcon()() ` Return the icon associated with this tab. |
| ` abstract int` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#getPosition()() ` Return the current position of this tab in the action bar. |
| ` abstract https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#getTag()() ` |
| ` abstract https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#getText()() ` Return the text of this tab. |
| ` abstract void` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#select()() ` Select this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setContentDescription(int)(int resId) ` Set a description of this tab's content for use in accessibility support. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setContentDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence contentDesc) ` Set a description of this tab's content for use in accessibility support. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setCustomView(int)(int layoutResId) ` Set a custom view to be used for this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setCustomView(android.view.View)(https://developer.android.com/reference/android/view/View view) ` Set a custom view to be used for this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setIcon(android.graphics.drawable.Drawable)(https://developer.android.com/reference/android/graphics/drawable/Drawable icon) ` Set the icon displayed on this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setIcon(int)(int resId) ` Set the icon displayed on this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setTabListener(android.app.ActionBar.TabListener)(https://developer.android.com/reference/android/app/ActionBar.TabListener listener) ` Set the `https://developer.android.com/reference/android/app/ActionBar.TabListener` that will handle switching to and from this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setTag(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Give this Tab an arbitrary object to hold for later use. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setText(int)(int resId) ` Set the text displayed on this tab. |
| ` abstract https://developer.android.com/reference/android/app/ActionBar.Tab` | ` https://developer.android.com/reference/android/app/ActionBar.Tab#setText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text) ` Set the text displayed on this tab. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### INVALID_POSITION

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INVALID_POSITION
```

An invalid position for a tab.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/ActionBar.Tab#getPosition()`

Constant Value: -1 (0xffffffff)

## Public constructors

### Tab

```
public Tab ()
```

<br />

<br />

## Public methods

### getContentDescription

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract CharSequence getContentDescription ()
```

Gets a brief description of this tab's content for use in accessibility support.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | Description of this tab's content <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/ActionBar.Tab#setContentDescription(java.lang.CharSequence)`
- `https://developer.android.com/reference/android/app/ActionBar.Tab#setContentDescription(int)`

### getCustomView

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract View getCustomView ()
```

Retrieve a previously set custom view for this tab.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | The custom view set by `https://developer.android.com/reference/android/app/ActionBar.Tab#setCustomView(android.view.View)`. <br /> |

### getIcon

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Drawable getIcon ()
```

Return the icon associated with this tab.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | The tab's icon <br /> |

### getPosition

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int getPosition ()
```

Return the current position of this tab in the action bar.

<br />

| Returns ||
|---|---|
| `int` | Current position, or `https://developer.android.com/reference/android/app/ActionBar.Tab#INVALID_POSITION` if this tab is not currently in the action bar. <br /> |

### getTag

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Object getTag ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | This Tab's tag object. <br /> |

### getText

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract CharSequence getText ()
```

Return the text of this tab.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The tab's text <br /> |

### select

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void select ()
```

Select this tab. Only valid if the tab has been added to the action bar.

<br />

### setContentDescription

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract 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.

<br />

| Parameters ||
|---|---|
| `resId` | `int`: A resource ID referring to the description text <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/ActionBar.Tab#setContentDescription(java.lang.CharSequence)`
- `https://developer.android.com/reference/android/app/ActionBar.Tab#getContentDescription()`

### setContentDescription

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract 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.

<br />

| Parameters ||
|---|---|
| `contentDesc` | `CharSequence`: Description of this tab's content <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/ActionBar.Tab#setContentDescription(int)`
- `https://developer.android.com/reference/android/app/ActionBar.Tab#getContentDescription()`

### setCustomView

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract ActionBar.Tab setCustomView (int layoutResId)
```

Set a custom view to be used for this tab. This overrides values set by `https://developer.android.com/reference/android/app/ActionBar.Tab#setText(java.lang.CharSequence)` and `https://developer.android.com/reference/android/app/ActionBar.Tab#setIcon(android.graphics.drawable.Drawable)`.

<br />

| Parameters ||
|---|---|
| `layoutResId` | `int`: A layout resource to inflate and use as a custom tab view <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setCustomView

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract ActionBar.Tab setCustomView (View view)
```

Set a custom view to be used for this tab. This overrides values set by `https://developer.android.com/reference/android/app/ActionBar.Tab#setText(java.lang.CharSequence)` and `https://developer.android.com/reference/android/app/ActionBar.Tab#setIcon(android.graphics.drawable.Drawable)`.

<br />

| Parameters ||
|---|---|
| `view` | `View`: Custom view to be used as a tab. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setIcon

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract ActionBar.Tab setIcon (Drawable icon)
```

Set the icon displayed on this tab.

<br />

| Parameters ||
|---|---|
| `icon` | `Drawable`: The drawable to use as an icon <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setIcon

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract ActionBar.Tab setIcon (int resId)
```

Set the icon displayed on this tab.

<br />

| Parameters ||
|---|---|
| `resId` | `int`: Resource ID referring to the drawable to use as an icon <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setTabListener

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract ActionBar.Tab setTabListener (ActionBar.TabListener listener)
```

Set the `https://developer.android.com/reference/android/app/ActionBar.TabListener` that will handle switching to and from this tab. All tabs must have a TabListener set before being added to the ActionBar.

<br />

| Parameters ||
|---|---|
| `listener` | `ActionBar.TabListener`: Listener to handle tab selection events <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setTag

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract ActionBar.Tab setTag (Object obj)
```

Give this Tab an arbitrary object to hold for later use.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: Object to store <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setText

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract 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.

<br />

| Parameters ||
|---|---|
| `resId` | `int`: A resource ID referring to the text that should be displayed <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |

### setText

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract 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.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence`: The text to display <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActionBar.Tab` | The current instance for call chaining <br /> |