# BrowserActionItem

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/browseractions/BrowserActionItem.java+class:androidx.browser.browseractions.BrowserActionItem) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

*** ** * ** ***


```
public class BrowserActionItem
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Browser Actions are deprecated as of release 1.2.0.

A wrapper class holding custom item of Browser Actions menu. The Bitmap is optional for a BrowserActionItem.

## Summary

| ### Public constructors |
|---|
| `[BrowserActionItem](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#BrowserActionItem(java.lang.String,android.app.PendingIntent))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html title, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html action)` **This method is deprecated.** Deprecated in Java |
| `[BrowserActionItem](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#BrowserActionItem(java.lang.String,android.app.PendingIntent,int))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html title, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html action, @https://developer.android.com/reference/androidx/annotation/DrawableRes int iconId )` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html` | `[getAction](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#getAction())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[getIconId](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#getIconId())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `[getTitle](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#getTitle())()` **This method is deprecated.** Deprecated in Java |

## Public constructors

### BrowserActionItem

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

```
public [BrowserActionItem](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#BrowserActionItem(java.lang.String,android.app.PendingIntent))(@NonNull String title, @NonNull PendingIntent action)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Constructor for BrowserActionItem with only string and action provided.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html title` | The icon shown for a custom item. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html action` | The string shown for a custom item. |

### BrowserActionItem

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

```
public [BrowserActionItem](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#BrowserActionItem(java.lang.String,android.app.PendingIntent,int))(
    @NonNull String title,
    @NonNull PendingIntent action,
    @DrawableRes int iconId
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Constructor for BrowserActionItem with icon, string and action provided.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html title` | The string shown for a custom item. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html action` | The PendingIntent executed when a custom item is selected |
| `@https://developer.android.com/reference/androidx/annotation/DrawableRes int iconId` | The resource id of the icon shown for a custom item. |

## Public methods

### getAction

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

```
public @NonNull PendingIntent [getAction](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#getAction())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html` | The action of a custom item. |

### getIconId

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

```
public int [getIconId](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#getIconId())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Returns |
|---|---|
| `int` | The resource id of the icon. |

### getTitle

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

```
public @NonNull String [getTitle](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem#getTitle())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | The title of a custom item. |