# ShortcutManagerCompat

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:[Methods](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#)  

# ShortcutManagerCompat

| 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
ShortcutManagerCompat
`  
`

extends Object


``


`

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

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[Intent](https://developer.android.com/reference/android/content/Intent.html) | ` `[createShortcutResultIntent](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#createShortcutResultIntent(android.content.Context, android.support.v4.content.pm.ShortcutInfoCompat))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[ShortcutInfoCompat](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat)` shortcut) ` Returns an Intent which can be used by the launcher to pin shortcut.                                                                                     |
| ` static boolean`                                                                       | ` `[isRequestPinShortcutSupported](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#isRequestPinShortcutSupported(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) `                                                                                                                                                                                                                                                                                                                                 |
| ` static boolean`                                                                       | ` `[requestPinShortcut](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#requestPinShortcut(android.content.Context, android.support.v4.content.pm.ShortcutInfoCompat, android.content.IntentSender))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[ShortcutInfoCompat](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutInfoCompat)` shortcut, `[IntentSender](https://developer.android.com/reference/android/content/IntentSender.html)` callback) ` Request to create a pinned shortcut. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#)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

### createShortcutResultIntent

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

```
Intent createShortcutResultIntent (Context context, 
                ShortcutInfoCompat shortcut)
```

Returns an Intent which can be used by the launcher to pin shortcut.

This should be used by an Activity to set result in response to[ACTION_CREATE_SHORTCUT](https://developer.android.com/reference/android/content/Intent.html#ACTION_CREATE_SHORTCUT).

<br />

|                          Parameters                          ||
|------------|--------------------------------------------------|
| `context`  | `Context` <br />                                 |
| `shortcut` | `ShortcutInfoCompat`: new shortcut to pin <br /> |

|                                                                          Returns                                                                           ||
|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [Intent](https://developer.android.com/reference/android/content/Intent.html) | the intent that should be set as the result for the calling activity <br /> |

**See also:**

- [ACTION_CREATE_SHORTCUT](https://developer.android.com/https://developer.android.com/reference/android/content/Intent#ACTION_CREATE_SHORTCUT)  

### isRequestPinShortcutSupported

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

```
boolean isRequestPinShortcutSupported (Context context)
```

<br />

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |

|                                                                                                                                                                          Returns                                                                                                                                                                          ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | `true`if the launcher supports[requestPinShortcut(Context, ShortcutInfoCompat, IntentSender)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#requestPinShortcut(android.content.Context, android.support.v4.content.pm.ShortcutInfoCompat, android.content.IntentSender)),`false`otherwise <br /> |

### requestPinShortcut

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

```
boolean requestPinShortcut (Context context, 
                ShortcutInfoCompat shortcut, 
                IntentSender callback)
```

Request to create a pinned shortcut.

On API \<= 25 it creates a legacy shortcut with the provided icon, label and intent. For newer APIs it will create a[ShortcutInfo](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html)object which can be updated by the app.

Use[getIntentSender()](https://developer.android.com/reference/android/app/PendingIntent.html#getIntentSender())to create a[IntentSender](https://developer.android.com/reference/android/content/IntentSender.html).

<br />

|                                              Parameters                                              ||
|------------|------------------------------------------------------------------------------------------|
| `context`  | `Context` <br />                                                                         |
| `shortcut` | `ShortcutInfoCompat`: new shortcut to pin <br />                                         |
| `callback` | `IntentSender`: if not null, this intent will be sent when the shortcut is pinned <br /> |

|                            Returns                            ||
|-----------|----------------------------------------------------|
| `boolean` | `true`if the launcher supports this feature <br /> |

**See also:**

- [isRequestPinShortcutSupported(Context)](https://developer.android.com/reference/android/support/v4/content/pm/ShortcutManagerCompat#isRequestPinShortcutSupported(android.content.Context))
- [IntentSender](https://developer.android.com/https://developer.android.com/reference/android/content/IntentSender)
- [getIntentSender()](https://developer.android.com/https://developer.android.com/reference/android/app/PendingIntent#getIntentSender())  
-

  ## 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)