BrowserActionsIntent

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

Class holding the Intent and start bundle for a Browser Actions Activity.

Note: The constants below are public for the browser implementation's benefit. You are strongly encouraged to use BrowserActionsIntent.Builder.

Summary

Nested classes

Builder class for opening a Browser Actions context menu.

Constants

static String

Indicates that the user explicitly opted out of Browser Actions in the calling application.

static String

Extra that specifies PendingIntent indicating which Application sends the .

static String

Extra that specifies List used for adding custom items to the Browser Actions menu.

static String

Extra that specifies the PendingIntent to be launched when a browser specified menu item is selected.

static String

Extra that specifies the type of url for the Browser Actions menu.

static Int

static Int

static Int

static Int

static Int

static Int

static String

Extra PendingIntent to be launched when a custom item is selected in the Browser Actions menu.

static String

Extra resource id that specifies the icon of a custom item shown in the Browser Actions menu.

static String

Extra string that specifies the title of a custom item shown in the Browser Actions menu.

static Int

The maximum allowed number of custom items.

static Int

static Int

static Int

static Int

static Int

static Int

Public methods

open static String!

Get the package name of the creator application.

open Intent

Gets the Intent of BrowserActionsIntent.

open static Unit
launchIntent(context: Context!, intent: Intent!)

Launch an Intent to open a Browser Actions menu.

open static Unit
openBrowserAction(context: Context!, uri: Uri!)

Construct a BrowserActionsIntent with default settings and launch it to open a Browser Actions menu.

open static Unit
openBrowserAction(context: Context!, uri: Uri!, type: Int, items: ArrayList<BrowserActionItem!>!, pendingIntent: PendingIntent!)

Construct a BrowserActionsIntent with custom settings and launch it to open a Browser Actions menu.

open static MutableList<BrowserActionItem!>!

Gets custom item list for browser action menu.

Constants

ACTION_BROWSER_ACTIONS_OPEN

static val ACTION_BROWSER_ACTIONS_OPEN: String

Indicates that the user explicitly opted out of Browser Actions in the calling application.

Value: "androidx.browser.browseractions.browser_action_open"

EXTRA_APP_ID

static val EXTRA_APP_ID: String

Extra that specifies PendingIntent indicating which Application sends the .

Value: "androidx.browser.browseractions.APP_ID"

EXTRA_MENU_ITEMS

static val EXTRA_MENU_ITEMS: String

Extra that specifies List used for adding custom items to the Browser Actions menu.

Value: "androidx.browser.browseractions.extra.MENU_ITEMS"

EXTRA_SELECTED_ACTION_PENDING_INTENT

static val EXTRA_SELECTED_ACTION_PENDING_INTENT: String

Extra that specifies the PendingIntent to be launched when a browser specified menu item is selected. The id of the chosen item will be notified through the data of its Intent.

Value: "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT"

EXTRA_TYPE

static val EXTRA_TYPE: String

Extra that specifies the type of url for the Browser Actions menu.

Value: "androidx.browser.browseractions.extra.TYPE"

ITEM_COPY

static val ITEM_COPY: Int
Value: 3

ITEM_DOWNLOAD

static val ITEM_DOWNLOAD: Int
Value: 2

ITEM_INVALID_ITEM

static val ITEM_INVALID_ITEM: Int
Value: -1

ITEM_OPEN_IN_INCOGNITO

static val ITEM_OPEN_IN_INCOGNITO: Int
Value: 1

ITEM_OPEN_IN_NEW_TAB

static val ITEM_OPEN_IN_NEW_TAB: Int
Value: 0

ITEM_SHARE

static val ITEM_SHARE: Int
Value: 4

KEY_ACTION

static val KEY_ACTION: String

Extra PendingIntent to be launched when a custom item is selected in the Browser Actions menu.

Value: "androidx.browser.browseractions.ACTION"

KEY_ICON_ID

static val KEY_ICON_ID: String

Extra resource id that specifies the icon of a custom item shown in the Browser Actions menu.

Value: "androidx.browser.browseractions.ICON_ID"

KEY_TITLE

static val KEY_TITLE: String

Extra string that specifies the title of a custom item shown in the Browser Actions menu.

Value: "androidx.browser.browseractions.TITLE"

MAX_CUSTOM_ITEMS

static val MAX_CUSTOM_ITEMS: Int

The maximum allowed number of custom items.

Value: 5

URL_TYPE_AUDIO

static val URL_TYPE_AUDIO: Int
Value: 3

URL_TYPE_FILE

static val URL_TYPE_FILE: Int
Value: 4

URL_TYPE_IMAGE

static val URL_TYPE_IMAGE: Int
Value: 1

URL_TYPE_NONE

static val URL_TYPE_NONE: Int
Value: 0

URL_TYPE_PLUGIN

static val URL_TYPE_PLUGIN: Int
Value: 5

URL_TYPE_VIDEO

static val URL_TYPE_VIDEO: Int
Value: 2

Public methods

getCreatorPackageName

open static fun getCreatorPackageName(intent: Intent!): String!

Get the package name of the creator application.

Parameters
intent Intent!: The BrowserActionsIntent.
Return
String!: The creator package name.

getIntent

@NonNull open fun getIntent(): Intent

Gets the Intent of BrowserActionsIntent.

Return
Intent: the Intent of BrowserActionsIntent.

launchIntent

open static fun launchIntent(context: Context!, intent: Intent!): Unit

Launch an Intent to open a Browser Actions menu. It first checks if any Browser Actions provider is available to create the menu. If the default Browser supports Browser Actions, menu will be opened by the default Browser, otherwise show a intent picker. If not provider, a Browser Actions menu is opened locally from support library.

Parameters
context Context!: The context requesting for a Browser Actions menu.
intent Context!: The Intent holds the setting for Browser Actions menu.

openBrowserAction

open static fun openBrowserAction(context: Context!, uri: Uri!): Unit

Construct a BrowserActionsIntent with default settings and launch it to open a Browser Actions menu.

Parameters
context Context!: The context requesting for a Browser Actions menu.
uri Context!: The url for Browser Actions menu.

openBrowserAction

open static fun openBrowserAction(context: Context!, uri: Uri!, type: Int, items: ArrayList<BrowserActionItem!>!, pendingIntent: PendingIntent!): Unit

Construct a BrowserActionsIntent with custom settings and launch it to open a Browser Actions menu.

Parameters
context Context!: The context requesting for a Browser Actions menu.
uri Context!: The url for Browser Actions menu.
type Context!: The type of the url for context menu to be opened.
items Context!: List of custom items to be added to Browser Actions menu.
pendingIntent Context!: The PendingIntent to be launched when a browser specified menu item is selected.

parseBrowserActionItems

open static fun parseBrowserActionItems(bundles: ArrayList<Bundle!>!): MutableList<BrowserActionItem!>!

Gets custom item list for browser action menu.

Parameters
bundles ArrayList<Bundle!>!: Data for custom items from BrowserActionsIntent.
Return
MutableList<BrowserActionItem!>!: List of BrowserActionItem