# ShortcutInfoCompat.Builder

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

*** ** * ** ***


```
public class ShortcutInfoCompat.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#Builder(android.content.Context,java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html id)` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#addCapabilityBinding(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html capability)` Associates a shortcut with a capability without any parameters. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#addCapabilityBinding(java.lang.String,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 capability, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parameter, @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> parameterValues )` Associates a shortcut with a capability, and a parameter of that capability. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#build()()` Creates a `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat` instance. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setActivity(android.content.ComponentName)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ComponentName.html activity)` Sets the target activity. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setAlwaysBadged()()` Badges the icon before passing it over to the Launcher. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setCategories(java.util.Set<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html> categories)` Sets categories for a shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setDisabledMessage(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html disabledMessage)` Sets the message that should be shown when the user attempts to start a shortcut that is disabled. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setExcludedFromSurfaces(int)(int surfaces)` Sets which surfaces a shortcut will be excluded from. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setExtras(android.os.PersistableBundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/PersistableBundle.html extras)` Extras that the app can set for any purpose. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setIcon(androidx.core.graphics.drawable.IconCompat)(https://developer.android.com/reference/androidx/core/graphics/drawable/IconCompat icon)` Sets an icon of a shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setIntent(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)` Sets the intent of a shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setIntents(android.content.Intent[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html Intent[] intents)` Sets multiple intents instead of a single intent, in order to launch an activity with other activities in back stack. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setIsConversation()()` Sets the corresponding fields indicating this shortcut is aimed for conversation. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setLocusId(androidx.core.content.LocusIdCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/content/LocusIdCompat locusId)` Sets the `https://developer.android.com/reference/androidx/core/content/LocusIdCompat` associated with this shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setLongLabel(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html longLabel)` Sets the text of a shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `[setLongLived](https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setLongLived())()` **This method is deprecated.** Use {@ink #setLongLived(boolean)) instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setLongLived(boolean)(boolean longLived)` Sets if a shortcut would be valid even if it has been unpublished/invisible by the app (as a dynamic or pinned shortcut). |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setPerson(androidx.core.app.Person)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/Person person)` Associate a person to a shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setPersons(androidx.core.app.Person[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html Person[] persons)` Sets multiple persons instead of a single person. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setRank(int)(int rank)` Sets rank of a shortcut, which is a non-negative value that's used by the system to sort shortcuts. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setShortLabel(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html shortLabel)` Sets the short title of a shortcut. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setSliceUri(android.net.Uri)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html sliceUri)` Sets the slice uri for a shortcut. |

## Public constructors

### Builder

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

```
public Builder(@NonNull Context context, @NonNull String id)
```

## Public methods

### addCapabilityBinding

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

```
public @NonNull ShortcutInfoCompat.Builder addCapabilityBinding(@NonNull String capability)
```

Associates a shortcut with a capability without any parameters. Used when the shortcut is an instance of a capability.

This method can be called multiple times to associate multiple capabilities with this shortcut.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html capability` | capability associated with the shortcut. e.g. actions.intent .START_EXERCISE. |

### addCapabilityBinding

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

```
public @NonNull ShortcutInfoCompat.Builder addCapabilityBinding(
    @NonNull String capability,
    @NonNull String parameter,
    @NonNull List<String> parameterValues
)
```

Associates a shortcut with a capability, and a parameter of that capability. Used when the shortcut is an instance of a capability.

This method can be called multiple times to associate multiple capabilities with this shortcut, or add multiple parameters to the same capability.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html capability` | capability associated with the shortcut. e.g. actions.intent .START_EXERCISE. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parameter` | the parameter associated with the capability. e.g. exercise.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> parameterValues` | a list of values for that parameters. The first value will be the primary name, while the rest will be alternative names. If the values are empty, then the parameter will not be saved in the shortcut. |

### build

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

```
public @NonNull ShortcutInfoCompat build()
```

Creates a `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat` instance.

### setActivity

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

```
public @NonNull ShortcutInfoCompat.Builder setActivity(@NonNull ComponentName activity)
```

Sets the target activity. A shortcut will be shown along with this activity's icon on the launcher.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getActivity()` |   |
| `https://developer.android.com/reference/android/content/pm/ShortcutInfo.Builder.html#setActivity(android.content.ComponentName)` |   |

### setAlwaysBadged

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

```
public @NonNull ShortcutInfoCompat.Builder setAlwaysBadged()
```

Badges the icon before passing it over to the Launcher.

Launcher automatically badges `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html`, so only the legacy shortcut icon, `https://developer.android.com/reference/android/content/Intent.ShortcutIconResource.html` is badged. This field is ignored when using `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html` on API 25 and above.

If the shortcut is associated with an activity, the activity icon is used as the badge, otherwise application icon is used.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setActivity(android.content.ComponentName)` |   |

### setCategories

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

```
public @NonNull ShortcutInfoCompat.Builder setCategories(@NonNull Set<String> categories)
```

Sets categories for a shortcut.

- Launcher apps may use this information to categorize shortcuts
- Used by the system to associate a published Sharing Shortcut with supported mimeTypes. Required for published Sharing Shortcuts with a matching category declared in share targets, defined in the app's manifest linked shortcuts xml file.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getCategories()` |   |

### setDisabledMessage

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

```
public @NonNull ShortcutInfoCompat.Builder setDisabledMessage(@NonNull CharSequence disabledMessage)
```

Sets the message that should be shown when the user attempts to start a shortcut that is disabled.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getDisabledMessage()` |   |

### setExcludedFromSurfaces

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

```
public @NonNull ShortcutInfoCompat.Builder setExcludedFromSurfaces(int surfaces)
```

Sets which surfaces a shortcut will be excluded from. This API is reserved for future extension. Currently, marking a shortcut to be excluded from `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat#SURFACE_LAUNCHER()` will not publish the shortcut, thus the following operations will be a no-op: `https://developer.android.com/reference/android/content/pm/ShortcutManager.html#pushDynamicShortcut(android.content.pm.ShortcutInfo)`, `https://developer.android.com/reference/android/content/pm/ShortcutManager.html#addDynamicShortcuts(java.util.List&lt;android.content.pm.ShortcutInfo&gt;)`, and `https://developer.android.com/reference/android/content/pm/ShortcutManager.html#setDynamicShortcuts(java.util.List&lt;android.content.pm.ShortcutInfo&gt;)`.

On API \<= 31, shortcuts that are excluded from `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat#SURFACE_LAUNCHER()` are not actually sent to `https://developer.android.com/reference/android/content/pm/ShortcutManager.html`. These shortcuts might still be made available to other surfaces via alternative means.

### setExtras

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

```
public @NonNull ShortcutInfoCompat.Builder setExtras(@NonNull PersistableBundle extras)
```

Extras that the app can set for any purpose.

Apps can store arbitrary shortcut metadata in extras and retrieve the metadata later using `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getExtras()`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getExtras()` |   |

### setIcon

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

```
public @NonNull ShortcutInfoCompat.Builder setIcon(IconCompat icon)
```

Sets an icon of a shortcut.

### setIntent

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

```
public @NonNull ShortcutInfoCompat.Builder setIntent(@NonNull Intent intent)
```

Sets the intent of a shortcut. Alternatively, `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setIntents(android.content.Intent[])` can be used to launch an activity with other activities in the back stack.

This is a mandatory field when publishing a new shortcut.

The given `intent` can contain extras, but these extras must contain values of primitive types in order for the system to persist these values.

### setIntents

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

```
public @NonNull ShortcutInfoCompat.Builder setIntents(@NonNull Intent[] intents)
```

Sets multiple intents instead of a single intent, in order to launch an activity with other activities in back stack. Use `https://developer.android.com/reference/android/app/TaskStackBuilder.html` to build intents. The last element in the list represents the only intent that doesn't place an activity on the back stack.

### setIsConversation

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

```
public @NonNull ShortcutInfoCompat.Builder setIsConversation()
```

Sets the corresponding fields indicating this shortcut is aimed for conversation.

If the shortcut is not associated with a `https://developer.android.com/reference/androidx/core/content/LocusIdCompat`, a `https://developer.android.com/reference/androidx/core/content/LocusIdCompat` based on `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat#getId()` will be added upon `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#build()`

Additionally, the shortcut will be long-lived.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setLongLived(boolean)` |   |

### setLocusId

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

```
public @NonNull ShortcutInfoCompat.Builder setLocusId(@Nullable LocusIdCompat locusId)
```

Sets the `https://developer.android.com/reference/androidx/core/content/LocusIdCompat` associated with this shortcut.

This method should be called when the `https://developer.android.com/reference/androidx/core/content/LocusIdCompat` is used in other places (such as `https://developer.android.com/reference/androidx/core/app/NotificationCompat` and `https://developer.android.com/reference/android/view/contentcapture/ContentCaptureContext.html`) so the device's intelligence services can correlate them.

### setLongLabel

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

```
public @NonNull ShortcutInfoCompat.Builder setLongLabel(@NonNull CharSequence longLabel)
```

Sets the text of a shortcut.

This field is intended to be more descriptive than the shortcut title. The launcher shows this instead of the short title when it has enough space.

The recommend maximum length is 25 characters.

### setLongLived

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

```
public @NonNull ShortcutInfoCompat.Builder [setLongLived](https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setLongLived())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use {@ink #setLongLived(boolean)) instead.

### setLongLived

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

```
public @NonNull ShortcutInfoCompat.Builder setLongLived(boolean longLived)
```

Sets if a shortcut would be valid even if it has been unpublished/invisible by the app (as a dynamic or pinned shortcut). If it is long lived, it can be cached by various system services even after it has been unpublished as a dynamic shortcut.

### setPerson

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

```
public @NonNull ShortcutInfoCompat.Builder setPerson(@NonNull Person person)
```

Associate a person to a shortcut. Alternatively, `https://developer.android.com/reference/androidx/core/content/pm/ShortcutInfoCompat.Builder#setPersons(androidx.core.app.Person[])` can be used to add multiple persons to a shortcut.

This is an optional field when publishing a new shortcut.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/app/Person` |   |

### setPersons

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

```
public @NonNull ShortcutInfoCompat.Builder setPersons(@NonNull Person[] persons)
```

Sets multiple persons instead of a single person.

### setRank

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

```
public @NonNull ShortcutInfoCompat.Builder setRank(int rank)
```

Sets rank of a shortcut, which is a non-negative value that's used by the system to sort shortcuts. Lower value means higher importance.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getRank()` | for details. |

### setShortLabel

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

```
public @NonNull ShortcutInfoCompat.Builder setShortLabel(@NonNull CharSequence shortLabel)
```

Sets the short title of a shortcut.

This is a mandatory field when publishing a new shortcut.

This field is intended to be a concise description of a shortcut.

The recommended maximum length is 10 characters.

### setSliceUri

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

```
public @NonNull ShortcutInfoCompat.Builder setSliceUri(@NonNull Uri sliceUri)
```

Sets the slice uri for a shortcut. The uri will be used if this shortcuts represents a slice, instead of an intent.