ShareTarget.Params

public class ShareTarget.Params


Contains parameter names to be used for the data being shared.

Summary

Constants

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

Bundle key for files.

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.

Public fields

final @Nullable List<ShareTarget.FileFormField>

Defines form fields for the files being shared, see FileFormField.

final @Nullable String

The name of the query parameter used for the body of the message being shared.

final @Nullable String

The name of the query parameter used for the title of the message being shared.

Public constructors

Params(
    @Nullable String title,
    @Nullable String text,
    @Nullable List<ShareTarget.FileFormField> files
)

Creates a Params with the given parameters.

Constants

KEY_FILES

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

Bundle key for files.

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.

Public fields

files

Added in 1.2.0
public final @Nullable List<ShareTarget.FileFormFieldfiles

Defines form fields for the files being shared, see FileFormField. Web Share Target can have multiple form fields associated with different MIME types. If a file passes the MIME type filters of several FileFormFields, the one that has the lowest index in this list is picked; see [1] for details. [1] https://wicg.github.io/web-share-target/level-2/#launching-the-web-share-target

text

Added in 1.2.0
public final @Nullable String text

The name of the query parameter used for the body of the message being shared.

title

Added in 1.2.0
public final @Nullable String title

The name of the query parameter used for the title of the message being shared.

Public constructors

Params

Added in 1.2.0
public Params(
    @Nullable String title,
    @Nullable String text,
    @Nullable List<ShareTarget.FileFormField> files
)

Creates a Params with the given parameters.

Parameters
@Nullable String title

The title.

@Nullable String text

The text.

@Nullable List<ShareTarget.FileFormField> files

The files.