# ShareCompat.IntentBuilder

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/ShareCompat.java+class:androidx.core.app.ShareCompat.IntentBuilder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public class ShareCompat.IntentBuilder
```

<br />

*** ** * ** ***

IntentBuilder is a helper for constructing `https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND` and `https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND_MULTIPLE` sharing intents and starting activities to share content. The ComponentName and package name of the calling activity will be included.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#IntentBuilder(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html launchingContext)` Create a new IntentBuilder for launching a sharing action from launchingContext. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addEmailBcc(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html address)` Add an email address to be used in the "bcc" field of the final Intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addEmailBcc(java.lang.String[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] addresses)` Add an array of email addresses to be used in the "bcc" field of the final Intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addEmailCc(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html address)` Add an email address to be used in the "cc" field of the final Intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addEmailCc(java.lang.String[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] addresses)` Add an array of email addresses to be used in the "cc" field of the final Intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addEmailTo(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html address)` Add an email address to be used in the "to" field of the final Intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addEmailTo(java.lang.String[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] addresses)` Add an array of email addresses to be used in the "to" field of the final Intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#addStream(android.net.Uri)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html streamUri)` Add a stream URI to the data that should be shared. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#createChooserIntent()()` Create an Intent that will launch the standard Android activity chooser, allowing the user to pick what activity/app on the system should handle the share. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `[from](https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#from(android.app.Activity))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Activity.html launchingActivity)` **This method is deprecated.** Use the constructor of IntentBuilder <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#getIntent()()` Retrieve the Intent as configured so far by the IntentBuilder. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setChooserTitle(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId)` Set the title that will be used for the activity chooser for this share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setChooserTitle(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html title)` Set the title that will be used for the activity chooser for this share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setEmailBcc(java.lang.String[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] addresses)` Set an array of email addresses to BCC on this share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setEmailCc(java.lang.String[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] addresses)` Set an array of email addresses to CC on this share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setEmailTo(java.lang.String[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] addresses)` Set an array of email addresses as recipients of this share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setHtmlText(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html htmlText)` Set an HTML string to be sent as part of the share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setIntentSender(android.content.IntentSender)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/IntentSender.html intentSender)` Set the IntentSender that will be used for the activity chooser callback when the user makes a choice. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setStream(android.net.Uri)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html streamUri)` Set a stream URI to the data that should be shared. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setSubject(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html subject)` Set a subject heading for this share; useful for sharing via email. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setText(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html text)` Set the literal text data to be sent as part of the share. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setType(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html mimeType)` Set the type of data being shared |
| `void` | `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#startChooser()()` Start a chooser activity for the current share intent. |

## Public constructors

### IntentBuilder

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

```
public IntentBuilder(@NonNull Context launchingContext)
```

Create a new IntentBuilder for launching a sharing action from launchingContext.

Note that builders that are not constructed with an `https://developer.android.com/reference/android/app/Activity.html` context (or a wrapped activity context) will not set the `https://developer.android.com/reference/androidx/core/app/ShareCompat#EXTRA_CALLING_ACTIVITY()` on the returned intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html launchingContext` | Context that the share will be launched from |

## Public methods

### addEmailBcc

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

```
public @NonNull ShareCompat.IntentBuilder addEmailBcc(@NonNull String address)
```

Add an email address to be used in the "bcc" field of the final Intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html address` | Email address to BCC |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_BCC` |   |

### addEmailBcc

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

```
public @NonNull ShareCompat.IntentBuilder addEmailBcc(@NonNull String[] addresses)
```

Add an array of email addresses to be used in the "bcc" field of the final Intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] addresses` | Email addresses to BCC |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_BCC` |   |

### addEmailCc

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

```
public @NonNull ShareCompat.IntentBuilder addEmailCc(@NonNull String address)
```

Add an email address to be used in the "cc" field of the final Intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html address` | Email address to CC |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_CC` |   |

### addEmailCc

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

```
public @NonNull ShareCompat.IntentBuilder addEmailCc(@NonNull String[] addresses)
```

Add an array of email addresses to be used in the "cc" field of the final Intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] addresses` | Email addresses to CC |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_CC` |   |

### addEmailTo

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

```
public @NonNull ShareCompat.IntentBuilder addEmailTo(@NonNull String address)
```

Add an email address to be used in the "to" field of the final Intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html address` | Email address to send to |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_EMAIL` |   |

### addEmailTo

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

```
public @NonNull ShareCompat.IntentBuilder addEmailTo(@NonNull String[] addresses)
```

Add an array of email addresses to be used in the "to" field of the final Intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] addresses` | Email addresses to send to |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_EMAIL` |   |

### addStream

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

```
public @NonNull ShareCompat.IntentBuilder addStream(@NonNull Uri streamUri)
```

Add a stream URI to the data that should be shared. If this is not the first stream URI added the final intent constructed will become an ACTION_SEND_MULTIPLE intent. Not all apps will handle both ACTION_SEND and ACTION_SEND_MULTIPLE.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html streamUri` | URI of the stream to share |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_STREAM` |   |
| `https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND` |   |
| `https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND_MULTIPLE` |   |

### createChooserIntent

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

```
public @NonNull Intent createChooserIntent()
```

Create an Intent that will launch the standard Android activity chooser, allowing the user to pick what activity/app on the system should handle the share.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html` | A chooser Intent for the currently configured sharing action |

### from

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static @NonNull ShareCompat.IntentBuilder [from](https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#from(android.app.Activity))(@NonNull Activity launchingActivity)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use the constructor of IntentBuilder

Create a new IntentBuilder for launching a sharing action from launchingActivity.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Activity.html launchingActivity` | Activity that the share will be launched from |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | a new IntentBuilder instance |

### getIntent

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

```
public @NonNull Intent getIntent()
```

Retrieve the Intent as configured so far by the IntentBuilder. This Intent is suitable for use in a ShareActionProvider or chooser dialog.

To create an intent that will launch the activity chooser so that the user may select a target for the share, see `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#createChooserIntent()`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html` | The current Intent being configured by this builder |

### setChooserTitle

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

```
public @NonNull ShareCompat.IntentBuilder setChooserTitle(@StringRes int resId)
```

Set the title that will be used for the activity chooser for this share.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/StringRes int resId` | Resource ID of the title string to use |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

### setChooserTitle

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

```
public @NonNull ShareCompat.IntentBuilder setChooserTitle(@Nullable CharSequence title)
```

Set the title that will be used for the activity chooser for this share.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html title` | Title string |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

### setEmailBcc

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

```
public @NonNull ShareCompat.IntentBuilder setEmailBcc(@Nullable String[] addresses)
```

Set an array of email addresses to BCC on this share. This replaces all current "BCC" recipients that have been set so far.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] addresses` | Email addresses to BCC on the share |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_BCC` |   |

### setEmailCc

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

```
public @NonNull ShareCompat.IntentBuilder setEmailCc(@Nullable String[] addresses)
```

Set an array of email addresses to CC on this share. This replaces all current "CC" recipients that have been set so far.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] addresses` | Email addresses to CC on the share |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_CC` |   |

### setEmailTo

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

```
public @NonNull ShareCompat.IntentBuilder setEmailTo(@Nullable String[] addresses)
```

Set an array of email addresses as recipients of this share. This replaces all current "to" recipients that have been set so far.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] addresses` | Email addresses to send to |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_EMAIL` |   |

### setHtmlText

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

```
public @NonNull ShareCompat.IntentBuilder setHtmlText(@Nullable String htmlText)
```

Set an HTML string to be sent as part of the share. If `https://developer.android.com/reference/android/content/Intent.html#EXTRA_TEXT` has not already been supplied, a styled version of the supplied HTML text will be added as EXTRA_TEXT as parsed by `https://developer.android.com/reference/android/text/Html.html#fromHtml(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html htmlText` | A string containing HTML markup as a richer version of the text provided by EXTRA_TEXT. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder#setText(java.lang.CharSequence)` |   |

### setIntentSender

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

```
public @NonNull ShareCompat.IntentBuilder setIntentSender(@Nullable IntentSender intentSender)
```

Set the IntentSender that will be used for the activity chooser callback when the user makes a choice.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/IntentSender.html intentSender` | IntentSender to use |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

### setStream

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

```
public @NonNull ShareCompat.IntentBuilder setStream(@Nullable Uri streamUri)
```

Set a stream URI to the data that should be shared.

This replaces all currently set stream URIs and will produce a single-stream ACTION_SEND intent.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html streamUri` | URI of the stream to share |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_STREAM` |   |

### setSubject

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

```
public @NonNull ShareCompat.IntentBuilder setSubject(@Nullable String subject)
```

Set a subject heading for this share; useful for sharing via email.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html subject` | Subject heading for this share |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_SUBJECT` |   |

### setText

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

```
public @NonNull ShareCompat.IntentBuilder setText(@Nullable CharSequence text)
```

Set the literal text data to be sent as part of the share. This may be a styled CharSequence.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html text` | Text to share |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#EXTRA_TEXT` |   |

### setType

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

```
public @NonNull ShareCompat.IntentBuilder setType(@Nullable String mimeType)
```

Set the type of data being shared

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html mimeType` | mimetype of the shared data |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/ShareCompat.IntentBuilder` | This IntentBuilder for method chaining |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html#setType(java.lang.String)` |   |

### startChooser

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

```
public void startChooser()
```

Start a chooser activity for the current share intent.