Udostępnij za pośrednictwem


PackageManager.GetResourcesForApplication Method

Definition

Overloads

GetResourcesForApplication(ApplicationInfo, Configuration)

Retrieve the resources for an application for the provided configuration.

GetResourcesForApplication(ApplicationInfo)

Retrieve the resources for an application.

GetResourcesForApplication(String)

Retrieve the resources associated with an application.

GetResourcesForApplication(ApplicationInfo, Configuration)

Retrieve the resources for an application for the provided configuration.

[Android.Runtime.Register("getResourcesForApplication", "(Landroid/content/pm/ApplicationInfo;Landroid/content/res/Configuration;)Landroid/content/res/Resources;", "GetGetResourcesForApplication_Landroid_content_pm_ApplicationInfo_Landroid_content_res_Configuration_Handler", ApiSince=31)]
public virtual Android.Content.Res.Resources GetResourcesForApplication (Android.Content.PM.ApplicationInfo app, Android.Content.Res.Configuration? configuration);
[<Android.Runtime.Register("getResourcesForApplication", "(Landroid/content/pm/ApplicationInfo;Landroid/content/res/Configuration;)Landroid/content/res/Resources;", "GetGetResourcesForApplication_Landroid_content_pm_ApplicationInfo_Landroid_content_res_Configuration_Handler", ApiSince=31)>]
abstract member GetResourcesForApplication : Android.Content.PM.ApplicationInfo * Android.Content.Res.Configuration -> Android.Content.Res.Resources
override this.GetResourcesForApplication : Android.Content.PM.ApplicationInfo * Android.Content.Res.Configuration -> Android.Content.Res.Resources

Parameters

app
ApplicationInfo

Information about the desired application.

configuration
Configuration

Overridden configuration when loading the Resources

Returns

Returns the application's Resources.

Attributes

Remarks

Retrieve the resources for an application for the provided configuration.

Java documentation for android.content.pm.PackageManager.getResourcesForApplication(android.content.pm.ApplicationInfo, android.content.res.Configuration).

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

GetResourcesForApplication(ApplicationInfo)

Retrieve the resources for an application.

[Android.Runtime.Register("getResourcesForApplication", "(Landroid/content/pm/ApplicationInfo;)Landroid/content/res/Resources;", "GetGetResourcesForApplication_Landroid_content_pm_ApplicationInfo_Handler")]
public abstract Android.Content.Res.Resources GetResourcesForApplication (Android.Content.PM.ApplicationInfo app);
[<Android.Runtime.Register("getResourcesForApplication", "(Landroid/content/pm/ApplicationInfo;)Landroid/content/res/Resources;", "GetGetResourcesForApplication_Landroid_content_pm_ApplicationInfo_Handler")>]
abstract member GetResourcesForApplication : Android.Content.PM.ApplicationInfo -> Android.Content.Res.Resources

Parameters

app
ApplicationInfo

Information about the desired application.

Returns

Returns the application's Resources.

Attributes

Exceptions

Thrown if the resources for the given application could not be loaded (most likely because it was uninstalled).

Remarks

Retrieve the resources for an application. Throws NameNotFoundException if the package is no longer installed.

Java documentation for android.content.pm.PackageManager.getResourcesForApplication(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.

Applies to

GetResourcesForApplication(String)

Retrieve the resources associated with an application.

[Android.Runtime.Register("getResourcesForApplication", "(Ljava/lang/String;)Landroid/content/res/Resources;", "GetGetResourcesForApplication_Ljava_lang_String_Handler")]
public abstract Android.Content.Res.Resources GetResourcesForApplication (string packageName);
[<Android.Runtime.Register("getResourcesForApplication", "(Ljava/lang/String;)Landroid/content/res/Resources;", "GetGetResourcesForApplication_Ljava_lang_String_Handler")>]
abstract member GetResourcesForApplication : string -> Android.Content.Res.Resources

Parameters

packageName
String

Package name of the application whose resources are to be retrieved.

Returns

Returns the application's Resources.

Attributes

Exceptions

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

Remarks

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

Java documentation for android.content.pm.PackageManager.getResourcesForApplication(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