# ShareTarget.FileFormField

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/trusted/sharing/ShareTarget.java+class:androidx.browser.trusted.sharing.ShareTarget.FileFormField) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

*** ** * ** ***


```
public final class ShareTarget.FileFormField
```

<br />

*** ** * ** ***

Defines a form field for sharing files.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#KEY_ACCEPTED_TYPES() = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES"` Bundle key for `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()`. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#KEY_NAME() = "androidx.browser.trusted.sharing.KEY_FILE_NAME"` Bundle key for `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()`. |

| ### Public fields |
|---|---|
| `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()` List of MIME types or file extensions to be sent in this field. |
| `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()` Name of the form field. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#FileFormField(java.lang.String,java.util.List<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html name, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> acceptedTypes)` Creates a `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField` with the given parameters. |

## Constants

### KEY_ACCEPTED_TYPES

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
public static final String KEY_ACCEPTED_TYPES = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES"
```

Bundle key for `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()`.

### KEY_NAME

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
public static final String KEY_NAME = "androidx.browser.trusted.sharing.KEY_FILE_NAME"
```

Bundle key for `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()`.

## Public fields

### acceptedTypes

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
public final @NonNull List<String> acceptedTypes
```

List of MIME types or file extensions to be sent in this field. The MIME type matching algorithm is specified by https://wicg.github.io/web-share-target/level-2/#determining-if-a-file-is-accepted.

### name

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
public final @NonNull String name
```

Name of the form field.

## Public constructors

### FileFormField

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
public FileFormField(@NonNull String name, @NonNull List<String> acceptedTypes)
```

Creates a `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField` with the given parameters.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html name` | The `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> acceptedTypes` | The `https://developer.android.com/reference/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()`. |