跳转到相应内容

最常访问

最近访问

navigation
added in API level 1

android.content.pm

Contains classes for accessing information about an application package, including information about its activities, permissions, services, signatures, and providers.

Most of the information about an application package is defined by its manifest file. For more information, see the AndroidManifest.xml File documentation.

Classes

ActivityInfo Information you can retrieve about a particular application activity or receiver. 
ActivityInfo.WindowLayout Contains information about position and size of the activity on the display. 
ApplicationInfo Information you can retrieve about a particular application. 
ApplicationInfo.DisplayNameComparator  
ChangedPackages Packages that have been changed since the last time they were requested. 
ComponentInfo Base class containing information common to all application components (ActivityInfo, ServiceInfo). 
ConfigurationInfo Information you can retrieve about hardware configuration preferences declared by an application. 
CrossProfileApps Class for handling cross profile operations. 
FeatureGroupInfo A set of features that can be requested by an application. 
FeatureInfo Definition of a single optional hardware or software feature of an Android device. 
InstrumentationInfo Information you can retrieve about a particular piece of test instrumentation. 
LabeledIntent A special subclass of Intent that can have a custom label/icon associated with it. 
LauncherActivityInfo A representation of an activity that can belong to this user or a managed profile associated with this user. 
LauncherApps Class for retrieving a list of launchable activities for the current user and any associated managed profiles that are visible to the current user, which can be retrieved with getProfiles()
LauncherApps.Callback Callbacks for package changes to this and related managed profiles. 
LauncherApps.PinItemRequest Represents a "pin shortcut" or a "pin appwidget" request made by an app, which is sent with an ACTION_CONFIRM_PIN_SHORTCUT or ACTION_CONFIRM_PIN_APPWIDGET intent respectively to the default launcher app. 
LauncherApps.ShortcutQuery Represents a query passed to getShortcuts(ShortcutQuery, UserHandle)
PackageInfo Overall information about the contents of a package. 
PackageInstaller Offers the ability to install, upgrade, and remove applications on the device. 
PackageInstaller.Session An installation that is being actively staged. 
PackageInstaller.SessionCallback Events for observing session lifecycle. 
PackageInstaller.SessionInfo Details for an active install session. 
PackageInstaller.SessionParams Parameters for creating a new PackageInstaller.Session
PackageItemInfo Base class containing information common to all package items held by the package manager. 
PackageItemInfo.DisplayNameComparator  
PackageManager Class for retrieving various kinds of information related to the application packages that are currently installed on the device. 
PackageStats This class was deprecated in API level 26. this class is an orphan that could never be obtained from a valid public API. If you need package storage statistics use the new StorageStatsManager APIs.  
PathPermission Description of permissions needed to access a particular path in a ProviderInfo
PermissionGroupInfo Information you can retrieve about a particular security permission group known to the system. 
PermissionInfo Information you can retrieve about a particular security permission known to the system. 
ProviderInfo Holds information about a specific content provider
ResolveInfo Information that is returned from resolving an intent against an IntentFilter. 
ResolveInfo.DisplayNameComparator  
ServiceInfo Information you can retrieve about a particular application service. 
SharedLibraryInfo This class provides information for a shared library. 
ShortcutInfo Represents a shortcut that can be published via ShortcutManager
ShortcutInfo.Builder Builder class for ShortcutInfo objects. 
ShortcutManager The ShortcutManager performs operations on an app's set of shortcuts
Signature Opaque, immutable representation of a signing certificate associated with an application package. 
VersionedPackage Encapsulates a package and its version code. 

Exceptions

PackageManager.NameNotFoundException This exception is thrown when a given package, application, or component name cannot be found. 
此网站会使用 Cookie 来存储您在此网站上指定的语言和显示选项偏好设置。

获取最新的 Android Developers 资讯和提示,助您在 Google Play 上取得成功。

* 必填字段

成功!

在微信上关注 Google Developers

要以浏览此网站吗?

您请求访问的是网页,但是您为此网站设置的语言偏好为

要更改您的语言偏好设置并以浏览此网站吗?如果以后您想要更改语言偏好设置,请使用每个页面底部的语言菜单。

该类需要 或更高的 API 级别

此文档已被隐藏,因为您为该文档选择的 API 级别是 。您可以使用左侧导航栏上方的选择器来更改文档的 API 级别。

要详细了解如何根据您的应用需求指定 API 级别,请参阅支持不同平台版本

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)