ShareTarget

public final class ShareTarget
extends Object

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


Describes a Web Share Target associated with a Trusted Web Activity. The structure of a ShareTarget object follows the specification [1] of the "share_target" object within web manifest json, with the following exceptions: - The "action" field specifies the full URL of the Share Target, and not only the path. - There is no "url" field in the "params" object, since urls are not supplied separately from text in Android's ACTION_SEND and ACTION_SEND_MULTIPLE intents. [1] https://wicg.github.io/web-share-target/level-2/

Summary

Nested classes

class ShareTarget.FileFormField

Defines a form field for sharing files. 

class ShareTarget.Params

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

Constants

String ENCODING_TYPE_MULTIPART

An encoding type to be used with POST requests (see encodingType) corresponding to multipart/form-data of the HTTP POST standard [1].

String ENCODING_TYPE_URL_ENCODED

An encoding type to be used with POST requests (see encodingType) corresponding to application/x-www-form-urlencoded of the HTTP POST standard [1].

String KEY_ACTION

Bundle key for action.

String KEY_ENCTYPE

Bundle key for encodingType.

String KEY_METHOD

Bundle key for method.

String KEY_PARAMS

Bundle key for params.

String METHOD_GET

See method.

String METHOD_POST

See method.

Fields

public final String action

URL of the Web Share Target.

public final String encodingType

Specifies how the shared data should be encoded in the body of a POST request.

public final String method

HTTP request method for the Web Share Target.

public final ShareTarget.Params params

Contains the parameter names, see ShareTarget.Params.

Public constructors

ShareTarget(String action, String method, String encodingType, ShareTarget.Params params)

Creates a