# ChooserAction.Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/service/chooser/ChooserAction.Builder "View this page in Java")  

```
class Builder
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                 ||
| ↳ | [android.service.chooser.ChooserAction.Builder](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction.Builder#) |

Builder class for[ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction)objects

## Summary

|                                                                                                                                                                                                                                                                                                                              Public constructors                                                                                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction.Builder#Builder(android.graphics.drawable.Icon,%20kotlin.CharSequence,%20android.app.PendingIntent))`(`icon:` `[Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#)`, `label:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`, `action:` `[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent.html#)`)` Construct a new builder for[ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction)object. |

|                                                                                                                                                                                           Public methods                                                                                                                                                                                            ||
|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction) | [build](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction.Builder#build())`()` Combine all of the options that have been set and return a new[ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction)object. |

## Public constructors

### Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
Builder(
    icon: Icon, 
    label: CharSequence, 
    action: PendingIntent)
```

Construct a new builder for[ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction)object.

|                                                                                                                                                        Parameters                                                                                                                                                        ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `icon`   | [Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#):an[Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#)representing this action, consisting of a white foreground atop a transparent background. This value cannot be`null`. |
| `label`  | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html):label the user-readable label for this action. This value cannot be`null`.                                                                                                                                       |
| `action` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent.html#):[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent.html#)to be invoked when the action is selected. This value cannot be`null`.                                          |

## Public methods

### build

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun build(): ChooserAction
```

Combine all of the options that have been set and return a new[ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction)object.

|                                                                       Return                                                                        ||
|-------------------------------------------------------------------------------------------------------|----------------------------------------------|
| [ChooserAction](https://developer.android.com/reference/kotlin/android/service/chooser/ChooserAction) | the built action This value cannot be`null`. |