compat/src/main/java/androidx/core/content/pm/ShortcutManagerCompat.java
@NonNull
    public static Intent createShortcutResultIntent(@NonNull Context context,
            @NonNull ShortcutInfoCompat shortcut) {
        Intent result = null;
        if (Build.VERSION.SDK_INT >= 26) {
            result = context.getSystemService(ShortcutManager.class)
                    .createShortcutResultIntent(shortcut.toShortcutInfo());
        }
        if (result == null) {
            result = new Intent();
        }
        return shortcut.addToIntent(result);
    }
/**
     * Returns an Intent which can be used by the launcher to pin shortcut.
     * <p>This should be used by an Activity to set result in response to
     * {@link Intent#ACTION_CREATE_SHORTCUT}.
     *
     * @param shortcut new shortcut to pin
     * @return the intent that should be set as the result for the calling activity
     *
     * @see Intent#ACTION_CREATE_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
Intent#ACTION_CREATE_SHORTCUT.

@param shortcut new shortcut to pin
@return the intent that should be set as the result for the calling activity


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 Intent#ACTION_CREATE_SHORTCUT . @param shortcut new shortcut to pin @return the intent that should be set as the result for the calling activity
@NonNull
    public static Intent createShortcutResultIntent(@NonNull Context context,
            @NonNull ShortcutInfoCompat shortcut) {
        Intent result = null;
        if (Build.VERSION.SDK_INT >= 26) {
            result = context.getSystemService(ShortcutManager.class)
                    .createShortcutResultIntent(shortcut.toShortcutInfo());
        }
        if (result == null) {
            result = new Intent();
        }
        return shortcut.addToIntent(result);
    }
@ NonNull public static Intent createShortcutResultIntent ( @ NonNull Context context , @ NonNull ShortcutInfoCompat shortcut ) { Intent result = null ; if ( Build . VERSION . SDK_INT >= 26 ) { result = context . getSystemService ( ShortcutManager . class ) . createShortcutResultIntent ( shortcut . toShortcutInfo ( ) ) ; } if ( result == null ) { result = new Intent ( ) ; } return shortcut . addToIntent ( result ) ; }
Returns an Intent which can be used by the launcher to pin shortcut.
Returns an Intent which can be used by the launcher to pin shortcut .