ShortcutManager.RequestPinShortcut(ShortcutInfo, IntentSender) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Request to create a pinned shortcut.
[Android.Runtime.Register("requestPinShortcut", "(Landroid/content/pm/ShortcutInfo;Landroid/content/IntentSender;)Z", "GetRequestPinShortcut_Landroid_content_pm_ShortcutInfo_Landroid_content_IntentSender_Handler", ApiSince=26)]
public virtual bool RequestPinShortcut (Android.Content.PM.ShortcutInfo shortcut, Android.Content.IntentSender? resultIntent);
[<Android.Runtime.Register("requestPinShortcut", "(Landroid/content/pm/ShortcutInfo;Landroid/content/IntentSender;)Z", "GetRequestPinShortcut_Landroid_content_pm_ShortcutInfo_Landroid_content_IntentSender_Handler", ApiSince=26)>]
abstract member RequestPinShortcut : Android.Content.PM.ShortcutInfo * Android.Content.IntentSender -> bool
override this.RequestPinShortcut : Android.Content.PM.ShortcutInfo * Android.Content.IntentSender -> bool
Parameters
- shortcut
- ShortcutInfo
Shortcut to pin. If an app wants to pin an existing (either static or dynamic) shortcut, then it only needs to have an ID. Although other fields don't have to be set, the target shortcut must be enabled.
<p>If it's a new shortcut, all the mandatory fields, such as a short label, must be
set.
- resultIntent
- IntentSender
If not null, this intent will be sent when the shortcut is pinned.
Use android.app.PendingIntent#getIntentSender() to create an IntentSender.
To avoid background execution limits, use an unexported, manifest-declared receiver.
For more details, see
<a href="/guide/topics/ui/shortcuts/creating-shortcuts.html#pinned">
Creating pinned shortcuts</a>.
Returns
TRUE if the launcher supports this feature. Note the API will return without
waiting for the user to respond, so getting TRUE from this API does not mean
the shortcut was pinned successfully. FALSE if the launcher doesn't support this
feature.
- Attributes
Remarks
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.