# 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
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/kotlin/androidx/browser/customtabs/CustomContentAction.Builder` and added to a `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent` using `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#addCustomContentAction(androidx.browser.customtabs.CustomContentAction)`.

## Summary

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

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction#getId()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction#getLabel()()` |
| `https://developer.android.com/reference/android/app/PendingIntent.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction#getPendingIntent()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomContentAction#getTargetType()()` |

## Public functions

### fromBundle

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

```
java-static fun fromBundle(bundle: Bundle): CustomContentAction
```

Creates a `https://developer.android.com/reference/kotlin/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)

```
fun getId(): Int
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The unique ID for this action. |

### getLabel

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

```
fun getLabel(): String
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.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)

```
fun getPendingIntent(): PendingIntent
```

| Returns |
|---|---|
| `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)

```
fun getTargetType(): Int
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The type of content this action applies to. |