# CustomContentAction

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) Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

*** ** * ** ***


```
@ExperimentalCustomContentAction
public final class CustomContentAction
```

<br />

*** ** * ** ***

Represents a custom action that can be invoked on specific content types (image or link) within a Custom Tab. Instances of this class are created using `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction.Builder` and added to a `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent` using `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#addCustomContentAction(androidx.browser.customtabs.CustomContentAction)`.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction.Builder` Builder class for `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` objects. |

| ### Public methods |
|---|---|
| `static @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#fromBundle(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html bundle)` Creates a `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction#getId()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction#getLabel()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction#getPendingIntent()()` |
| `int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction#getTargetType()()` |

## Public methods

### fromBundle

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

```
public static @NonNull CustomContentAction fromBundle(@NonNull Bundle bundle)
```

Creates a `https://developer.android.com/reference/androidx/browser/customtabs/CustomContentAction` from a `https://developer.android.com/reference/android/os/Bundle.html`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the bundle is malformed or missing required fields. |

### getId

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

```
public int getId()
```

| Returns |
|---|---|
| `int` | The unique ID for this action. |

### getLabel

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

```
public @NonNull String getLabel()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | The user-visible label for this action. |

### getPendingIntent

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

```
public @NonNull PendingIntent getPendingIntent()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html` | The `https://developer.android.com/reference/android/app/PendingIntent.html` to be sent when this action is triggered. |

### getTargetType

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

```
public int getTargetType()
```

| Returns |
|---|---|
| `int` | The type of content this action applies to. |