ShareData

public final class ShareData


Contains data to be delivered to a Web Share Target via a Trusted Web Activity. See setShareParams.

Summary

Constants

static final String
KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT"

Bundle key for text.

static final String
KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE"

Bundle key for title.

static final String
KEY_URIS = "androidx.browser.trusted.sharing.KEY_URIS"

Bundle key for uris.

Public fields

final @Nullable String

Text of the shared message.

final @Nullable String

Title of the shared message.

final @Nullable List<Uri>

URIs of files to be shared.

Public constructors

ShareData(
    @Nullable String title,
    @Nullable String text,
    @Nullable List<Uri> uris
)

Creates a ShareData with the given parameters.

Public methods

static @NonNull ShareData

Unpacks the object from a Bundle.

@NonNull Bundle

Packs the object into a Bundle

Constants

KEY_TEXT

Added in 1.2.0
public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT"

Bundle key for text.

KEY_TITLE

Added in 1.2.0
public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE"

Bundle key for title.

KEY_URIS

Added in 1.2.0
public static final String KEY_URIS = "androidx.browser.trusted.sharing.KEY_URIS"

Bundle key for uris.

Public fields

text

Added in 1.2.0
public final @Nullable String text

Text of the shared message.

title

Added in 1.2.0
public final @Nullable String title

Title of the shared message.

uris

Added in 1.2.0
public final @Nullable List<Uriuris

URIs of files to be shared.

Public constructors

ShareData

Added in 1.2.0
public ShareData(
    @Nullable String title,
    @Nullable String text,
    @Nullable List<Uri> uris
)

Creates a ShareData with the given parameters.

Parameters
@Nullable String title

The title.

@Nullable String text

The text.

@Nullable List<Uri> uris

The uris.

Public methods

fromBundle

Added in 1.2.0
public static @NonNull ShareData fromBundle(@NonNull Bundle bundle)

Unpacks the object from a Bundle.

toBundle

Added in 1.2.0
public @NonNull Bundle toBundle()

Packs the object into a Bundle