标签:
private boolean isAvilible(Context context, String packageName) {}
/**
* 检测该包名所对应的应用是否存在
*
* @param packageName
* @return
*/
public boolean checkPackage(String packageName) {
if (packageName == null || "".equals(packageName))
return false;
try {
getPackageManager().getApplicationInfo(packageName,
PackageManager.GET_UNINSTALLED_PACKAGES);
return true;
} catch (NameNotFoundException e) {
return false;
}
}
标签:
原文地址:http://blog.csdn.net/abc546201056/article/details/42739667