lightbulb_outline Please take our October 2018 developer survey. Start survey
added in version 1.0.0
belongs to Maven artifact androidx.browser:browser:1.0.0

BrowserActionsIntent.Builder

public static final class BrowserActionsIntent.Builder
extends Object

java.lang.Object
   ↳ androidx.browser.browseractions.BrowserActionsIntent.Builder


Builder class for opening a Browser Actions context menu.

Summary

Public constructors

BrowserActionsIntent.Builder(Context context, Uri uri)

Constructs a BrowserActionsIntent.Builder object associated with default setting for a selected url.

Public methods

BrowserActionsIntent build()

Combines all the options that have been set and returns a new BrowserActionsIntent object.

BrowserActionsIntent.Builder setCustomItems(ArrayList<BrowserActionItem> items)

Sets the custom items list.

BrowserActionsIntent.Builder setCustomItems(BrowserActionItem... items)

Sets the custom items list.

BrowserActionsIntent.Builder setOnItemSelectedAction(PendingIntent onItemSelectedPendingIntent)

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

BrowserActionsIntent.Builder setUrlType(int type)

Sets the type of Browser Actions context menu.

Inherited methods

Public constructors

BrowserActionsIntent.Builder

added in version 1.0.0
public BrowserActionsIntent.Builder (Context context, 
                Uri uri)

Constructs a BrowserActionsIntent.Builder object associated with default setting for a selected url.

Parameters
context Context: The context requesting the Browser Actions context menu.

uri Uri: The selected url for Browser Actions menu.

Public methods

build

added in version 1.0.0
public BrowserActionsIntent build ()

Combines all the options that have been set and returns a new BrowserActionsIntent object.

Returns
BrowserActionsIntent

setCustomItems

added in version 1.0.0
public BrowserActionsIntent.Builder setCustomItems (ArrayList<BrowserActionItem> items)

Sets the custom items list. Only maximum MAX_CUSTOM_ITEMS custom items are allowed, otherwise throws an IllegalStateException.

Parameters
items ArrayList: The list of BrowserActionItem for custom items.

Returns
BrowserActionsIntent.Builder

setCustomItems

added in version 1.0.0
public BrowserActionsIntent.Builder setCustomItems (BrowserActionItem... items)

Sets the custom items list. Only maximum MAX_CUSTOM_ITEMS custom items are allowed, otherwise throws an IllegalStateException.

Parameters
items BrowserActionItem: The varargs of BrowserActionItem for custom items.

Returns
BrowserActionsIntent.Builder

setOnItemSelectedAction

added in version 1.0.0
public BrowserActionsIntent.Builder setOnItemSelectedAction (PendingIntent onItemSelectedPendingIntent)

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

Parameters
onItemSelectedPendingIntent PendingIntent: The PendingIntent to be launched.

Returns
BrowserActionsIntent.Builder

setUrlType

added in version 1.0.0
public BrowserActionsIntent.Builder setUrlType (int type)

Sets the type of Browser Actions context menu.

Parameters
type int: The type of url.

Returns
BrowserActionsIntent.Builder