CustomContentAction.Builder


public final class CustomContentAction.Builder


Builder class for CustomContentAction objects.

Summary

Public constructors

Builder(
    @IntRange(from = 0) int id,
    @NonNull String label,
    @NonNull PendingIntent pendingIntent,
    int targetType
)

Creates a new Builder for CustomContentAction.

Public methods

@NonNull CustomContentAction

Builds the CustomContentAction instance.

Public constructors

Builder

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

Creates a new Builder for CustomContentAction.

Parameters
@IntRange(from = 0) int id

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.

@NonNull String label

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.

@NonNull PendingIntent pendingIntent

The PendingIntent to be sent when this action is triggered.

int targetType

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

Public methods

build

Added in 1.9.0-rc01
public @NonNull CustomContentAction build()

Builds the CustomContentAction instance.