List<ApplicationInfo> currInfo = mPackageManager.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo tmpInf :
currInfo) {
PackageInfo info =
mPackageManager.getPackageInfo(tmpInf.packageName, 0);
if(tmpInf.packageName.equals(PACKAGE_YOU_NEED_TO_CHECK))
// A package you need is installed
}
1条答案
按热度按时间blmhpbnm1#
您可以使用packagemanager:
如果您运行的是android 11及以上版本,则需要以下权限:
然后,您可以按如下方式对其进行迭代: