# BrowserActionsIntent.Builder

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/browseractions/BrowserActionsIntent.java+class:androidx.browser.browseractions.BrowserActionsIntent.Builder) 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 final class BrowserActionsIntent.Builder
```

<br />

*** ** * ** ***

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

Builder class for opening a Browser Actions context menu.

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#Builder(android.content.Context,android.net.Uri))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html uri)` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent` | `[build](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#build())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder` | `[setCustomItems](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setCustomItems(androidx.browser.browseractions.BrowserActionItem...))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html BrowserActionItem[] items)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder` | `[setCustomItems](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem> items)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder` | `[setOnItemSelectedAction](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setOnItemSelectedAction(android.app.PendingIntent))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html onItemSelectedPendingIntent )` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder` | `[setUrlType](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setUrlType(int))(int type)` **This method is deprecated.** Deprecated in Java |

## Public constructors

### Builder

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 [Builder](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#Builder(android.content.Context,android.net.Uri))(@NonNull Context context, @NonNull Uri uri)
```

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

Constructs a `https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder` object associated with default setting for a selected url.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | The context requesting the Browser Actions context menu. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html uri` | The selected url for Browser Actions menu. |

## Public methods

### build

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 BrowserActionsIntent [build](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#build())()
```

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

Combines all the options that have been set and returns a new `https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent` object.

### setCustomItems

```
public @NonNull BrowserActionsIntent.Builder [setCustomItems](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setCustomItems(androidx.browser.browseractions.BrowserActionItem...))(@NonNull BrowserActionItem[] items)
```

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

Sets the custom items list. Only maximum MAX_CUSTOM_ITEMS custom items are allowed, otherwise throws an `https://developer.android.com/reference/java/lang/IllegalStateException.html`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html BrowserActionItem[] items` | The varargs of `https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem` for custom items. |

### setCustomItems

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 BrowserActionsIntent.Builder [setCustomItems](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>))(@NonNull ArrayList<BrowserActionItem> items)
```

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

Sets the custom items list. Only maximum MAX_CUSTOM_ITEMS custom items are allowed, otherwise throws an `https://developer.android.com/reference/java/lang/IllegalStateException.html`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem> items` | The list of `https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionItem` for custom items. |

### setOnItemSelectedAction

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 BrowserActionsIntent.Builder [setOnItemSelectedAction](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setOnItemSelectedAction(android.app.PendingIntent))(
    @NonNull PendingIntent onItemSelectedPendingIntent
)
```

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

Set the PendingIntent to be launched when a a browser specified menu item is selected.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html onItemSelectedPendingIntent` | The PendingIntent to be launched. |

### setUrlType

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 BrowserActionsIntent.Builder [setUrlType](https://developer.android.com/reference/androidx/browser/browseractions/BrowserActionsIntent.Builder#setUrlType(int))(int type)
```

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

Sets the type of Browser Actions context menu.

| Parameters |
|---|---|
| `int type` | The type of url. |