belongs to Maven artifact androidx.browser:browser:1.0.0-alpha1

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

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

BrowserActionsIntent build ()

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

Returns
BrowserActionsIntent

setCustomItems

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

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

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

BrowserActionsIntent.Builder setUrlType (int type)

Sets the type of Browser Actions context menu.

Parameters
type int: The type of url.

Returns
BrowserActionsIntent.Builder