Builder
class Builder
kotlin.Any | |
↳ | androidx.browser.browseractions.BrowserActionsIntent.Builder |
Builder class for opening a Browser Actions context menu.
Summary
Public constructors | |
---|---|
Constructs a |
Public methods | |
---|---|
BrowserActionsIntent |
build() Combines all the options that have been set and returns a new object. |
BrowserActionsIntent.Builder |
setCustomItems(@NonNull items: ArrayList<BrowserActionItem!>) Sets the custom items list. |
BrowserActionsIntent.Builder |
setCustomItems(@NonNull vararg items: BrowserActionItem!) Sets the custom items list. |
BrowserActionsIntent.Builder |
setOnItemSelectedAction(@NonNull 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(
@NonNull context: Context,
@NonNull 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
@NonNull fun build(): BrowserActionsIntent
Combines all the options that have been set and returns a new object.
setCustomItems
@NonNull fun setCustomItems(@NonNull 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
@NonNull fun setCustomItems(@NonNull 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
@NonNull fun setOnItemSelectedAction(@NonNull 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
@NonNull fun setUrlType(type: Int): BrowserActionsIntent.Builder
Sets the type of Browser Actions context menu.
Parameters | |
---|---|
type |
Int: The type of url. |