Sdílet prostřednictvím


PackageManager.GetApplicationIcon Method

Definition

Overloads

GetApplicationIcon(ApplicationInfo)

Retrieve the icon associated with an application.

GetApplicationIcon(String)

Retrieve the icon associated with an application.

GetApplicationIcon(ApplicationInfo)

Retrieve the icon associated with an application.

[Android.Runtime.Register("getApplicationIcon", "(Landroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;", "GetGetApplicationIcon_Landroid_content_pm_ApplicationInfo_Handler")]
public abstract Android.Graphics.Drawables.Drawable GetApplicationIcon (Android.Content.PM.ApplicationInfo info);
[<Android.Runtime.Register("getApplicationIcon", "(Landroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;", "GetGetApplicationIcon_Landroid_content_pm_ApplicationInfo_Handler")>]
abstract member GetApplicationIcon : Android.Content.PM.ApplicationInfo -> Android.Graphics.Drawables.Drawable

Parameters

info
ApplicationInfo

Information about application being queried.

Returns

Returns the image of the icon, or the default application icon if it could not be found.

Attributes

Remarks

Retrieve the icon associated with an application. If it has not defined an icon, the default app icon is returned. Does not return null.

Java documentation for android.content.pm.PackageManager.getApplicationIcon(android.content.pm.ApplicationInfo).

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.

See also

Applies to

GetApplicationIcon(String)

Retrieve the icon associated with an application.

[Android.Runtime.Register("getApplicationIcon", "(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;", "GetGetApplicationIcon_Ljava_lang_String_Handler")]
public abstract Android.Graphics.Drawables.Drawable GetApplicationIcon (string packageName);
[<Android.Runtime.Register("getApplicationIcon", "(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;", "GetGetApplicationIcon_Ljava_lang_String_Handler")>]
abstract member GetApplicationIcon : string -> Android.Graphics.Drawables.Drawable

Parameters

packageName
String

Name of the package whose application icon is to be retrieved.

Returns

Returns the image of the icon, or the default application icon if it could not be found. Does not return null.

Attributes

Exceptions

Thrown if the resources for the given application could not be loaded.

Remarks

Retrieve the icon associated with an application. Given the name of the application's package, retrieves the information about it and calls getApplicationIcon() to return its icon. If the application cannot be found, NameNotFoundException is thrown.

Java documentation for android.content.pm.PackageManager.getApplicationIcon(java.lang.String).

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.

See also

Applies to