CustomContentAction.Builder


class CustomContentAction.Builder


Builder class for CustomContentAction objects.

Summary

Public constructors

Builder(
    id: @IntRange(from = 0) Int,
    label: String,
    pendingIntent: PendingIntent,
    targetType: Int
)

Creates a new Builder for CustomContentAction.

Public functions

CustomContentAction

Builds the CustomContentAction instance.

Public constructors

Builder

Added in 1.9.0-rc01
Builder(
    id: @IntRange(from = 0) Int,
    label: String,
    pendingIntent: PendingIntent,
    targetType: Int
)

Creates a new Builder for CustomContentAction.

Parameters
id: @IntRange(from = 0) Int

A unique integer ID for this action. This ID will be sent back to your application when the action is triggered. It should be unique among all custom content actions added to a single CustomTabsIntent.

label: String

The user-visible label for this action (e.g., "Pin Image", "Share Link with App X"). The browser will display this text, but may truncate or otherwise alter it to fit its own UI limitations, which can vary between browsers.

pendingIntent: PendingIntent

The PendingIntent to be sent when this action is triggered.

targetType: Int

The type of content this action applies to (e.g., CONTENT_TARGET_TYPE_IMAGE or CONTENT_TARGET_TYPE_LINK).

Public functions

build

Added in 1.9.0-rc01
fun build(): CustomContentAction

Builds the CustomContentAction instance.