# ShareData

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/ShareData.java+class:androidx.browser.trusted.sharing.ShareData) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

*** ** * ** ***


```
class ShareData
```

<br />

*** ** * ** ***

Contains data to be delivered to a Web Share Target via a Trusted Web Activity. See `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setShareParams(androidx.browser.trusted.sharing.ShareTarget,androidx.browser.trusted.sharing.ShareData)`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#KEY_TEXT() = "androidx.browser.trusted.sharing.KEY_TEXT"` Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#text()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#KEY_TITLE() = "androidx.browser.trusted.sharing.KEY_TITLE"` Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#title()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#KEY_URIS() = "androidx.browser.trusted.sharing.KEY_URIS"` Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#uris()`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#ShareData(java.lang.String,java.lang.String,java.util.List<android.net.Uri>)(title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, uris: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html!>?)` Creates a `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData` with the given parameters. |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html)` Unpacks the object from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#toBundle()()` Packs the object into a `https://developer.android.com/reference/android/os/Bundle.html` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#text()` Text of the shared message. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#title()` Title of the shared message. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html!>?` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#uris()` URIs of files to be shared. |

## Constants

### KEY_TEXT

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

```
const val KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT": String!
```

Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#text()`.

### KEY_TITLE

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

```
const val KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE": String!
```

Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#title()`.

### KEY_URIS

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

```
const val KEY_URIS = "androidx.browser.trusted.sharing.KEY_URIS": String!
```

Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#uris()`.

## Public constructors

### ShareData

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

```
ShareData(title: String?, text: String?, uris: (Mutable)List<Uri!>?)
```

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

| Parameters |
|---|---|
| `title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#title()`. |
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#text()`. |
| `uris: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html!>?` | The `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData#uris()`. |

## Public functions

### fromBundle

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

```
java-static fun fromBundle(bundle: Bundle): ShareData
```

Unpacks the object from a `https://developer.android.com/reference/android/os/Bundle.html`.

### toBundle

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

```
fun toBundle(): Bundle
```

Packs the object into a `https://developer.android.com/reference/android/os/Bundle.html`

## Public properties

### text

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

```
val text: String?
```

Text of the shared message.

### title

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

```
val title: String?
```

Title of the shared message.

### uris

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

```
val uris: (Mutable)List<Uri!>?
```

URIs of files to be shared.