The Android Developer Challenge is back! Submit your idea before December 2.

Builder

class Builder
kotlin.Any
   ↳ androidx.browser.browseractions.BrowserActionsIntent.Builder

Builder class for opening a Browser Actions context menu.

Summary

Public constructors

<init>(context: Context!, uri: Uri!)

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

Public methods

BrowserActionsIntent!

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

BrowserActionsIntent.Builder!

Sets the custom items list.

BrowserActionsIntent.Builder!

Sets the custom items list.

BrowserActionsIntent.Builder!
setOnItemSelectedAction(onItemSelectedPendingIntent: PendingIntent!)

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

BrowserActionsIntent.Builder!
setUrlType(type: Int)

Sets the type of Browser Actions context menu.

Public constructors

<init>

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 Context!: The selected url for Browser Actions menu.

Public methods

build

fun build(): BrowserActionsIntent!

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

setCustomItems

fun setCustomItems(items: ArrayList<BrowserActionItem!>!): BrowserActionsIntent.Builder!

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

Parameters
items ArrayList<BrowserActionItem!>!: The list of BrowserActionItem for custom items.

setCustomItems

fun setCustomItems(vararg items: BrowserActionItem!): BrowserActionsIntent.Builder!

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.

setOnItemSelectedAction

fun setOnItemSelectedAction(onItemSelectedPendingIntent: PendingIntent!): BrowserActionsIntent.Builder!

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

Parameters
onItemSelectedPendingIntent PendingIntent!: The PendingIntent to be launched.

setUrlType

fun setUrlType(type: Int): BrowserActionsIntent.Builder!

Sets the type of Browser Actions context menu.

Parameters
type Int: The type of url.