Condividi tramite


Package.GetPackage(String) Method

Definition

Find a package by name in the callers ClassLoader instance.

[Android.Runtime.Register("getPackage", "(Ljava/lang/String;)Ljava/lang/Package;", "")]
public static Java.Lang.Package? GetPackage (string? name);
[<Android.Runtime.Register("getPackage", "(Ljava/lang/String;)Ljava/lang/Package;", "")>]
static member GetPackage : string -> Java.Lang.Package

Parameters

name
String

a package name, for example, java.lang.

Returns

the package of the requested name. It may be null if no package information is available from the archive or codebase.

Attributes

Remarks

Find a package by name in the callers ClassLoader instance. The callers ClassLoader instance is used to find the package instance corresponding to the named class. If the callers ClassLoader instance is null then the set of packages loaded by the system ClassLoader instance is searched to find the named package.

Packages have attributes for versions and specifications only if the class loader created the package instance with the appropriate attributes. Typically, those attributes are defined in the manifests that accompany the classes.

Java documentation for java.lang.Package.getPackage(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.

Applies to

See also