BrowserActionsIntent

public class BrowserActionsIntent
extends Object

java.lang.Object
   ↳ androidx.browser.browseractions.BrowserActionsIntent


This class is deprecated.
Browser Actions are deprecated as of release 1.2.0.

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

class BrowserActionsIntent.Builder

Builder class for opening a Browser Actions context menu. 

Constants

String ACTION_BROWSER_ACTIONS_OPEN

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

String EXTRA_APP_ID

Extra that specifies PendingIntent indicating which Application sends the BrowserActionsIntent.

String EXTRA_MENU_ITEMS

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

String EXTRA_SELECTED_ACTION_PENDING_INTENT

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

String EXTRA_TYPE

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

int ITEM_COPY

int ITEM_DOWNLOAD

int ITEM_INVALID_ITEM

int ITEM_OPEN_IN_INCOGNITO

int ITEM_OPEN_IN_NEW_TAB

int ITEM_SHARE

String KEY_ACTION

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

String KEY_ICON_ID

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

String KEY_TITLE

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

int MAX_CUSTOM_ITEMS

The maximum allowed number of custom items.

int URL_TYPE_AUDIO

int URL_TYPE_FILE

int URL_TYPE_IMAGE

int URL_TYPE_NONE

int URL_TYPE_PLUGIN

int URL_TYPE_VIDEO

Public methods

static String getCreatorPackageName(Intent intent)

This method is deprecated. This return value of this method cannot be trusted, it is kept around for compatibility. Use getUntrustedCreatorPackageName(Intent), or an alternative method if you rely on the return value.

Intent getIntent()

Gets the Intent of BrowserActionsIntent.

static String getUntrustedCreatorPackageName(Intent intent)

Get the package name of the creator application.

static void launchIntent(Context context, Intent intent)

Launch an Intent to open a Browser Actions menu.

static void openBrowserAction(Context context, Uri uri, int type, ArrayList<BrowserActionItem> items, PendingIntent pendingIntent)

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

static void openBrowserAction(Context context, Uri uri)

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

static List<BrowserActionItem> parseBrowserActionItems(ArrayList<Bundle> bundles)

Gets custom item list for browser action menu.

Inherited methods

Constants

ACTION_BROWSER_ACTIONS_OPEN

public static final String ACTION_BROWSER_ACTIONS_OPEN

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

Constant Value: "androidx.browser.browseractions.browser_action_open"

EXTRA_APP_ID

public static final String EXTRA_APP_ID

Extra that specifies PendingIntent indicating which Application sends the BrowserActionsIntent.

Note: The PendingIntent is self-reported and untrusted, sending application can modify it to use PendingIntent from other apps. This would return the package name from the app who creates the PendintIntent.

Constant Value: "androidx.browser.browseractions.APP_ID"

EXTRA_MENU_ITEMS

public static final String EXTRA_MENU_ITEMS

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

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