PackageManager.GetDrawable(String, Int32, ApplicationInfo) 方法

定义

从包中检索映像。

[Android.Runtime.Register("getDrawable", "(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_ILandroid_content_pm_ApplicationInfo_Handler")]
public abstract Android.Graphics.Drawables.Drawable? GetDrawable (string packageName, int resid, Android.Content.PM.ApplicationInfo? appInfo);
[<Android.Runtime.Register("getDrawable", "(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_ILandroid_content_pm_ApplicationInfo_Handler")>]
abstract member GetDrawable : string * int * Android.Content.PM.ApplicationInfo -> Android.Graphics.Drawables.Drawable

参数

packageName
String

此图标来自的包的名称。 不可为 null。

resid
Int32

所需映像的资源标识符。 不能为 0。

appInfo
ApplicationInfo

有关 <var>packageName</var> 的总体信息。 这可能为 null,在这种情况下,将根据需要检索应用程序信息;如果已经有此信息,可以更高效地在此处提供这些信息。

返回

返回保存所请求图像的绘图器。 如果出于任何原因找不到图像,则返回 null。

属性

注解

从包中检索映像。 这是各种包管理器信息结构(例如 ComponentInfo 实现关联图标检索)使用的低级别 API。

适用于 . 的 android.content.pm.PackageManager.getDrawable(java.lang.String, int, android.content.pm.ApplicationInfo)Java 文档

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

适用于