Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

BrowserActionItem

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

A wrapper class holding custom item of Browser Actions menu. The Bitmap is optional for a BrowserActionItem.

Summary

Public constructors

<init>(@NonNull title: String, @NonNull action: PendingIntent, @DrawableRes iconId: Int)

Constructor for BrowserActionItem with icon, string and action provided.

<init>(@NonNull title: String, @NonNull action: PendingIntent)

Constructor for BrowserActionItem with only string and action provided.

Public methods

open PendingIntent

open Int

open String

Public constructors

<init>

BrowserActionItem(@NonNull title: String, @NonNull action: PendingIntent, @DrawableRes iconId: Int)

Constructor for BrowserActionItem with icon, string and action provided.

Parameters
title String: The string shown for a custom item.
action String: The PendingIntent executed when a custom item is selected
iconId String: The resource id of the icon shown for a custom item.

<init>

BrowserActionItem(@NonNull title: String, @NonNull action: PendingIntent)

Constructor for BrowserActionItem with only string and action provided.

Parameters
title String: The icon shown for a custom item.
action String: The string shown for a custom item.

Public methods

getAction

@NonNull open fun getAction(): PendingIntent
Return
PendingIntent: The action of a custom item.

getIconId

open fun getIconId(): Int
Return
Int: The resource id of the icon.

getTitle

@NonNull open fun getTitle(): String
Return
String: The title of a custom item.