LauncherApps.GetShortcutIconDrawable(ShortcutInfo, Int32) Method

Definition

Returns the icon for this shortcut, without any badging for the profile.

[Android.Runtime.Register("getShortcutIconDrawable", "(Landroid/content/pm/ShortcutInfo;I)Landroid/graphics/drawable/Drawable;", "GetGetShortcutIconDrawable_Landroid_content_pm_ShortcutInfo_IHandler", ApiSince=25)]
public virtual Android.Graphics.Drawables.Drawable? GetShortcutIconDrawable (Android.Content.PM.ShortcutInfo shortcut, int density);
[<Android.Runtime.Register("getShortcutIconDrawable", "(Landroid/content/pm/ShortcutInfo;I)Landroid/graphics/drawable/Drawable;", "GetGetShortcutIconDrawable_Landroid_content_pm_ShortcutInfo_IHandler", ApiSince=25)>]
abstract member GetShortcutIconDrawable : Android.Content.PM.ShortcutInfo * int -> Android.Graphics.Drawables.Drawable
override this.GetShortcutIconDrawable : Android.Content.PM.ShortcutInfo * int -> Android.Graphics.Drawables.Drawable

Parameters

shortcut
ShortcutInfo
density
Int32

The preferred density of the icon, zero for default density. Use density DPI values from DisplayMetrics.

Returns

The drawable associated with the shortcut.

Attributes

Remarks

Returns the icon for this shortcut, without any badging for the profile.

The calling launcher application must be allowed to access the shortcut information, as defined in #hasShortcutHostPermission().

Java documentation for android.content.pm.LauncherApps.getShortcutIconDrawable(android.content.pm.ShortcutInfo, int).

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