LauncherApps.GetShortcutIconDrawable(ShortcutInfo, Int32) 方法

定义

返回此快捷方式的图标,不对配置文件进行任何错误。

[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

参数

shortcut
ShortcutInfo
density
Int32

图标的首选密度,默认密度为零。 使用来自 DisplayMetrics. 的密度 DPI 值。

返回

与快捷方式关联的可绘制项。

属性

注解

返回此快捷方式的图标,不对配置文件进行任何错误。

必须允许调用启动器应用程序访问快捷方式信息,如中 #hasShortcutHostPermission()定义。

适用于 . 的 android.content.pm.LauncherApps.getShortcutIconDrawable(android.content.pm.ShortcutInfo, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于