PackageManager.GetResourcesForApplication Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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.
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.
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.