I want to check whether an app is installed on the device or not. I am using code below :
PackageManager pm = context.getPackageManager();
List<PackageInfo> packageInfoList = pm.getInstalledPackages(PackageManager.GET_ACTIVITIES);
if (packageInfoList != null) {
for (PackageInfo packageInfo : packageInfoList) {
Log.d(TAG, "-->"+packageInfo.packageName);
String packageName = packageInfo.packageName;
if (packageName != null && packageName.equals(uri)) {
return true;
}
}
}
return false;
Which gives me all the packages but not the one that I except. I am trying to find this app : rootcloak and exposed installer Not able to find these apps with the code above.