# CustomContentAction.Builder

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/customtabs/CustomContentAction.java+class:androidx.browser.customtabs.CustomContentAction.Builder) Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

*** ** * ** ***


```
public final class CustomContentAction.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction.Builder#Builder(int,java.lang.String,android.app.PendingIntent,int)( @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int id, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html label, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent, int targetType )` Creates a new Builder for `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction.Builder#build()()` Builds the `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` instance. |

## Public constructors

### Builder

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

```
public Builder(
    @IntRange(from = 0) int id,
    @NonNull String label,
    @NonNull PendingIntent pendingIntent,
    int targetType
)
```

Creates a new Builder for `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int id` | A unique integer ID for this action. This ID will be sent back to your application when the action is triggered. It should be unique among all custom content actions added to a single `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html label` | The user-visible label for this action (e.g., "Pin Image", "Share Link with App X"). The browser will display this text, but may truncate or otherwise alter it to fit its own UI limitations, which can vary between browsers. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent` | The `https://developer.android.com/reference/android/app/PendingIntent.html` to be sent when this action is triggered. |
| `int targetType` | The type of content this action applies to (e.g., `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent#CONTENT_TARGET_TYPE_IMAGE()` or `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent#CONTENT_TARGET_TYPE_LINK()`). |

## Public methods

### build

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

```
public @NonNull CustomContentAction build()
```

Builds the `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` instance.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` | The built `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction`. |