# TabContents.Builder

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.Builder) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
public final class TabContents.Builder
```

<br />

*** ** * ** ***

A builder of `https://developer.android.com/reference/androidx/car/app/model/TabContents`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/model/TabContents.Builder#Builder(androidx.car.app.model.Template)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/Template template)` Creates a `https://developer.android.com/reference/androidx/car/app/model/TabContents.Builder` instance using the given `https://developer.android.com/reference/androidx/car/app/model/Template` to display as contents. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/TabContents` | `https://developer.android.com/reference/androidx/car/app/model/TabContents.Builder#build()()` Constructs the `https://developer.android.com/reference/androidx/car/app/model/TabContents` defined by this builder. |

## Public constructors

### Builder

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

```
public Builder(@NonNull Template template)
```

Creates a `https://developer.android.com/reference/androidx/car/app/model/TabContents.Builder` instance using the given `https://developer.android.com/reference/androidx/car/app/model/Template` to display as contents.

There should be no title, Header `https://developer.android.com/reference/androidx/car/app/model/Action` or `https://developer.android.com/reference/androidx/car/app/model/ActionStrip` set on the template. The host will ignore these.

From Car API 6 onward, the following template types are supported as content:

- `ListTemplate`
- `PaneTemplate`
- `GridTemplate`
- `MessageTemplate`
- `SearchTemplate`

From Car API 7 onward, the following template type is supported as content in addition to all previously supported template types:

- `NavigationTemplate`

From Car API 8 onward, the following template type is supported as content in addition to all previously supported template types:

- `SectionedItemTemplate`

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `template` is null |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `template` does not meet the requirements |

## Public methods

### build

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

```
public @NonNull TabContents build()
```

Constructs the `https://developer.android.com/reference/androidx/car/app/model/TabContents` defined by this builder.