# ShortcutInfoCompat

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#nestedclasses)\|[Methods](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#)  

# ShortcutInfoCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
ShortcutInfoCompat
`  
`

extends Object


``


`

|---|--------------------------------------------------|
| java.lang.Object                                    ||
| ↳ | android.support.v4.content.pm.ShortcutInfoCompat |

<br />

*** ** * ** ***

Helper for accessing features in[ShortcutInfo](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html).

## Summary

|                                                                                                                                ### Nested classes                                                                                                                                ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [ShortcutInfoCompat.Builder](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder) Builder class for[ShortcutInfoCompat](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat)objects. |

|                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                   ||
|-------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[ComponentName](https://developer.android.com/reference/android/content/ComponentName.html)  | ` `[getActivity](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getActivity())`() ` Return the target activity.                                                                                                                                                            |
| ` CharSequence`                                                                                 | ` `[getDisabledMessage](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getDisabledMessage())`() ` Return the message that should be shown when the user attempts to start a shortcut that is disabled.                                                                     |
| ` String`                                                                                       | ` `[getId](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getId())`() ` Returns the ID of a shortcut.                                                                                                                                                                      |
| ` `[Intent](https://developer.android.com/reference/android/content/Intent.html)                | ` `[getIntent](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getIntent())`() ` Returns the intent that is executed when the user selects this shortcut.                                                                                                                   |
| ` `[Intent[]](https://developer.android.com/reference/android/content/Intent.html)              | ` `[getIntents](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getIntents())`() ` Return the intent set with[setIntents(Intent[])](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setIntents(android.content.Intent[])). |
| ` CharSequence`                                                                                 | ` `[getLongLabel](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getLongLabel())`() ` Return the long description of a shortcut.                                                                                                                                           |
| ` CharSequence`                                                                                 | ` `[getShortLabel](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#getShortLabel())`() ` Return the short description of a shortcut.                                                                                                                                        |
| ` `[ShortcutInfo](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html) | ` `[toShortcutInfo](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#toShortcutInfo())`() `                                                                                                                                                                                  |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public methods

### getActivity

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
ComponentName getActivity ()
```

Return the target activity.

This has nothing to do with the activity that this shortcut will launch. Launcher apps should show the launcher icon for the returned activity alongside this shortcut.

<br />

|                                               Returns                                               ||
|---------------------------------------------------------------------------------------------|--------|
| [ComponentName](https://developer.android.com/reference/android/content/ComponentName.html) | <br /> |

**See also:**

- [setActivity(ComponentName)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setActivity(android.content.ComponentName))  

### getDisabledMessage

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CharSequence getDisabledMessage ()
```

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

<br />

|        Returns         ||
|----------------|--------|
| `CharSequence` | <br /> |

**See also:**

- [setDisabledMessage(CharSequence)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setDisabledMessage(java.lang.CharSequence))  

### getId

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getId ()
```

Returns the ID of a shortcut.

Shortcut IDs are unique within each publisher app and must be stable across devices so that shortcuts will still be valid when restored on a different device. See[ShortcutManager](https://developer.android.com/reference/android/content/pm/ShortcutManager.html)for details.

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### getIntent

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Intent getIntent ()
```

Returns the intent that is executed when the user selects this shortcut. If setIntents() was used, then return the last intent in the array.

<br />

|                                        Returns                                        ||
|-------------------------------------------------------------------------------|--------|
| [Intent](https://developer.android.com/reference/android/content/Intent.html) | <br /> |

**See also:**

- [setIntent(Intent)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setIntent(android.content.Intent))  

### getIntents

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Intent[] getIntents ()
```

Return the intent set with[setIntents(Intent[])](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setIntents(android.content.Intent[])).

<br />

|                                         Returns                                         ||
|---------------------------------------------------------------------------------|--------|
| [Intent[]](https://developer.android.com/reference/android/content/Intent.html) | <br /> |

**See also:**

- [setIntents(Intent[])](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setIntents(android.content.Intent[]))  

### getLongLabel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CharSequence getLongLabel ()
```

Return the long description of a shortcut.

<br />

|        Returns         ||
|----------------|--------|
| `CharSequence` | <br /> |

**See also:**

- [setLongLabel(CharSequence)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setLongLabel(java.lang.CharSequence))  

### getShortLabel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CharSequence getShortLabel ()
```

Return the short description of a shortcut.

<br />

|        Returns         ||
|----------------|--------|
| `CharSequence` | <br /> |

**See also:**

- [setShortLabel(CharSequence)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder#setShortLabel(java.lang.CharSequence))  

### toShortcutInfo

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
ShortcutInfo toShortcutInfo ()
```

<br />

<br />

|                                                                                                             Returns                                                                                                              ||
|----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| [ShortcutInfo](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html) | [ShortcutInfo](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html)object from this compat object. <br /> |

-

  ## Classes

  - [ActivityInfoCompat](https://developer.android.com/reference/android/support/v4/content/pm/ActivityInfoCompat)
  - [ShortcutInfoCompat](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat)
  - [ShortcutInfoCompat.Builder](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat.Builder)
  - [ShortcutManagerCompat](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat)