public abstract class PackageManager extends Object
java.lang.Object | |
↳ | android.content.pm.PackageManager |
- PackageManager是抽象类,该类是用来检索那些已安装应用包的各种各样的信息。获取该类实例的方式是通过getPackageManager()方法。 (Class for retrieving various kinds of information related to the application packages that are currently installed on the device. You can find this class through
getPackageManager()
.) - 利用PackageManager可以实现以下功能,
- 添加动态权限--addxxx类方法
- 检测是否具有某项权限、签名等---checkxxx方法
- 获取应用信息、包信息、版本号、logo、等---getxxx方法
- 移除指定权限等---removexxx方法
- 常用方法介绍
- getPackageInfo(String packageName, int flags)
- getActivityInfo(ComponentName component, int flags)
- getInstalledApplications(int flags)
- getInstalledPackages(int flags)
- queryContentProviders(String processName, int uid, int flags)
- queryBroadcastReceivers(Intent intent, int flags)
- abstract List<PackageInfo> getInstalledPackages(int flags)