Freigeben über


ShortcutManager.CreateShortcutResultIntent(ShortcutInfo) Method

Definition

Returns an Intent which can be used by the default launcher to pin a shortcut containing the given ShortcutInfo.

[Android.Runtime.Register("createShortcutResultIntent", "(Landroid/content/pm/ShortcutInfo;)Landroid/content/Intent;", "GetCreateShortcutResultIntent_Landroid_content_pm_ShortcutInfo_Handler", ApiSince=26)]
public virtual Android.Content.Intent? CreateShortcutResultIntent (Android.Content.PM.ShortcutInfo shortcut);
[<Android.Runtime.Register("createShortcutResultIntent", "(Landroid/content/pm/ShortcutInfo;)Landroid/content/Intent;", "GetCreateShortcutResultIntent_Landroid_content_pm_ShortcutInfo_Handler", ApiSince=26)>]
abstract member CreateShortcutResultIntent : Android.Content.PM.ShortcutInfo -> Android.Content.Intent
override this.CreateShortcutResultIntent : Android.Content.PM.ShortcutInfo -> Android.Content.Intent

Parameters

shortcut
ShortcutInfo

New shortcut to pin. If an app wants to pin an existing (either dynamic or manifest) shortcut, then it only needs to have an ID, and other fields don't have to be set, in which case, the target shortcut must be enabled. If it's a new shortcut, all the mandatory fields, such as a short label, must be set.

Returns

The intent that should be set as the result for the calling activity, or null if the current launcher doesn't support shortcuts.

Attributes

Remarks

Returns an Intent which can be used by the default launcher to pin a shortcut containing the given ShortcutInfo. This method should be used by an Activity to set a result in response to Intent#ACTION_CREATE_SHORTCUT.

Java documentation for android.content.pm.ShortcutManager.createShortcutResultIntent(android.content.pm.ShortcutInfo).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to