# Action.Builder

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/provider/Action.kt+class:androidx.credentials.provider.Action.Builder) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***

<br />

```
class Action.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action.Builder#Builder(kotlin.CharSequence,android.app.PendingIntent)(title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html, pendingIntent: https://developer.android.com/reference/android/app/PendingIntent.html)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action.Builder#build()()` Builds an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action` |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action.Builder#setSubtitle(kotlin.CharSequence)(subtitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)` Sets a sub title to be shown on the UI with this entry |

## Public constructors

### Builder

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
Builder(title: CharSequence, pendingIntent: PendingIntent)
```

| Parameters |
|---|---|
| `title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | the title of this action entry |
| `pendingIntent: https://developer.android.com/reference/android/app/PendingIntent.html` | the `https://developer.android.com/reference/android/app/PendingIntent.html` that will get invoked when the user selects this entry, must be created with a unique request code per entry, with flag `https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_MUTABLE` to allow the Android system to attach the final request, and NOT with flag `https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_ONE_SHOT` as it can be invoked multiple times |

## Public functions

### build

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
fun build(): Action
```

Builds an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action`

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/provider/Action.Builder#title()` is empty |

### setSubtitle

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
fun setSubtitle(subtitle: CharSequence?): Action.Builder
```

Sets a sub title to be shown on the UI with this entry