BrowserActionsIntent.Builder

Added in 1.2.0
Deprecated in 1.2.0

public final class BrowserActionsIntent.Builder


Builder class for opening a Browser Actions context menu.

Summary

Public constructors

Builder(@NonNull Context context, @NonNull Uri uri)

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

Public methods

@NonNull BrowserActionsIntent

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

@NonNull BrowserActionsIntent.Builder
setCustomItems(@NonNull BrowserActionItem[] items)

Sets the custom items list.

@NonNull BrowserActionsIntent.Builder

Sets the custom items list.

@NonNull BrowserActionsIntent.Builder
setOnItemSelectedAction(
    @NonNull PendingIntent onItemSelectedPendingIntent
)

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

@NonNull BrowserActionsIntent.Builder
setUrlType(int type)

Sets the type of Browser Actions context menu.

Public constructors

Builder

Added in 1.2.0
Deprecated in 1.2.0
public Builder(@NonNull Context context, @NonNull Uri uri)

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

Parameters
@NonNull Context context

The context requesting the Browser Actions context menu.

@NonNull Uri uri

The selected url for Browser Actions menu.

Public methods

build

Added in 1.2.0
Deprecated in 1.2.0
public @NonNull BrowserActionsIntent build()

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

setCustomItems

public @NonNull BrowserActionsIntent.Builder setCustomItems(@NonNull BrowserActionItem[] items)

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

Parameters
@NonNull BrowserActionItem[] items

The varargs of BrowserActionItem for custom items.

setCustomItems

Added in 1.2.0
Deprecated in 1.2.0
public @NonNull BrowserActionsIntent.Builder setCustomItems(@NonNull ArrayList<BrowserActionItem> items)

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

Parameters
@NonNull ArrayList<BrowserActionItem> items

The list of BrowserActionItem for custom items.

setOnItemSelectedAction

Added in 1.2.0
Deprecated in 1.2.0
public @NonNull BrowserActionsIntent.Builder setOnItemSelectedAction(
    @NonNull PendingIntent onItemSelectedPendingIntent
)

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

Parameters
@NonNull PendingIntent onItemSelectedPendingIntent

The PendingIntent to be launched.

setUrlType

Added in 1.2.0
Deprecated in 1.2.0
public @NonNull BrowserActionsIntent.Builder setUrlType(int type)

Sets the type of Browser Actions context menu.

Parameters
int type

The type of url.