# TabContents

# TabContents

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/model/TabContents.java+class:androidx.car.app.model.TabContents)  
Added in[1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/TabContents "View this page in Java")

<br />

```
@CarProtocol
@RequiresCarApi(value = 6)
class TabContents : Content
```

<br />

*** ** * ** ***

Represents the contents to display for a selected tab in a[TabTemplate](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabTemplate). Only certain templates may be used as content. See[Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents.Builder#Builder(androidx.car.app.model.Template))for more details.

## Summary

|                                                                                                            ### Nested types                                                                                                            |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[TabContents.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents.Builder) A builder of[TabContents](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents). |

|                                        ### Constants                                         |
|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [CONTENT_ID](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#CONTENT_ID())` = "TAB_CONTENTS_CONTENT_ID"` Content ID for TabContents |

|                                    ### Public functions                                    |
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)        | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                               |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)          | [getContentId](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#getContentId())`()` Returns the static content ID associated with TabContents.                                                                             |
| [Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template) | [getTemplate](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#getTemplate())`()` Returns the wrapped[Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template)to display as the contents. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#hashCode())`()`                                                                                                                                                |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)          | [toString](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#toString())`()`                                                                                                                                                |

## Constants

### CONTENT_ID

Added in[1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)  

```
const val CONTENT_ID = "TAB_CONTENTS_CONTENT_ID": String!
```

Content ID for TabContents

This Content ID will be used to refresh the displayed template in the TabContents.  

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```  

### getContentId

```
fun getContentId(): String
```

Returns the static content ID associated with TabContents.  

|                                                   See also                                                   |
|--------------------------------------------------------------------------------------------------------------|---|
| [CONTENT_ID](https://developer.android.com/reference/kotlin/androidx/car/app/model/TabContents#CONTENT_ID()) |   |

### getTemplate

Added in[1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)  

```
fun getTemplate(): Template
```

Returns the wrapped[Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template)to display as the contents.  

### hashCode

```
fun hashCode(): Int
```  

### toString

```
fun toString(): String
```