# ActionStrip.Builder

# 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)

*** ** * ** ***

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

<br />

```
class ActionStrip.Builder
```

<br />

*** ** * ** ***

A builder of[ActionStrip](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip).

## Summary

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

|                                               ### Public functions                                               |
|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ActionStrip.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip.Builder) | [addAction](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip.Builder#addAction(androidx.car.app.model.Action))`(action: `[Action](https://developer.android.com/reference/kotlin/androidx/car/app/model/Action)`)` Adds an[Action](https://developer.android.com/reference/kotlin/androidx/car/app/model/Action)to the list. |
| [ActionStrip](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip)                 | [build](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip.Builder#build())`()` Constructs the[ActionStrip](https://developer.android.com/reference/kotlin/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)  

```
Builder()
```

Creates an empty[Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip.Builder)instance.  

## Public functions

### addAction

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

```
fun addAction(action: Action): ActionStrip.Builder
```

Adds an[Action](https://developer.android.com/reference/kotlin/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                                                         |
|-----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.IllegalArgumentException](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. |
| [java.lang.NullPointerException](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)  

```
fun build(): ActionStrip
```

Constructs the[ActionStrip](https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip)defined by this builder.  

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