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

*** ** * ** ***


```
public final class ActionStrip.Builder
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/model/ActionStrip.Builder#Builder()()` Creates an empty `https://developer.android.com/reference/androidx/car/app/model/ActionStrip.Builder` instance. |

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

## Public constructors

### Builder

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

```
public Builder()
```

Creates an empty `https://developer.android.com/reference/androidx/car/app/model/ActionStrip.Builder` instance.

## Public methods

### addAction

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

```
public @NonNull ActionStrip.Builder addAction(@NonNull Action action)
```

Adds an `https://developer.android.com/reference/androidx/car/app/model/Action` to the list.

Spans are not supported in the title of the action and will be ignored.

Only the primary action for navigation and map templates will have the background color applied. Setting the background color has no effect in other templates.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `action` is a standard action and an action of the same type has already been added, of if the `action`'s title contains unsupported spans. |
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `action` is `null` |

### build

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

```
public @NonNull ActionStrip build()
```

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

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if the action strip is empty |