ShareData

public final class ShareData
extends Object

java.lang.Object
   ↳ androidx.browser.trusted.sharing.ShareData


Contains data to be delivered to a Web Share Target via a Trusted Web Activity. See TrustedWebActivityIntentBuilder.setShareParams(ShareTarget, ShareData).

Summary

Constants

String KEY_TEXT

Bundle key for text.

String KEY_TITLE

Bundle key for title.

String KEY_URIS

Bundle key for uris.

Fields

public final String text

Text of the shared message.

public final String title

Title of the shared message.

public final List<Uri> uris

URIs of files to be shared.

Public constructors

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

Creates a ShareData with the given parameters.

Public methods

static ShareData fromBundle(Bundle bundle)

Unpacks the object from a Bundle.

Bundle toBundle()

Packs the object into a Bundle

Inherited methods

Constants

KEY_TEXT

public static final String KEY_TEXT

Bundle key for text.

Constant Value: "androidx.browser.trusted.sharing.KEY_TEXT"

KEY_TITLE

public static final String KEY_TITLE

Bundle key for title.

Constant Value: "androidx.browser.trusted.sharing.KEY_TITLE"

KEY_URIS

public static final String KEY_URIS

Bundle key for uris.

Constant Value: "androidx.browser.trusted.sharing.KEY_URIS"

Fields

text

public final String text

Text of the shared message.

title

public final String title

Title of the shared message.

uris

public final List<Uri> uris

URIs of files to be shared.

Public constructors

ShareData

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

Creates a ShareData with the given parameters.

Parameters
title String: The title.

text String: The text.

uris List: The uris.

Public methods

fromBundle

public static ShareData fromBundle (Bundle bundle)

Unpacks the object from a Bundle.

Parameters
bundle Bundle

Returns
ShareData

toBundle

public Bundle toBundle ()

Packs the object into a Bundle

Returns
Bundle