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 | |
---|---|
Builder(Context context, Uri uri)
Constructs a |
Public methods | |
---|---|
BrowserActionsIntent
|
build()
Combines all the options that have been set and returns a new |
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
Builder
public 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
public BrowserActionsIntent build ()
Combines all the options that have been set and returns a new BrowserActionsIntent
object.
Returns | |
---|---|
BrowserActionsIntent |
setCustomItems
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
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
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
public BrowserActionsIntent.Builder setUrlType (int type)
Sets the type of Browser Actions context menu.
Parameters | |
---|---|
type |
int : The type of url.
|
Returns | |
---|---|
BrowserActionsIntent.Builder |