private boolean appInstalledOrNot(String uri) {
PackageManager pm = resourcesManager.activity.getPackageManager();
boolean app_installed = false;
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
app_installed = true;
} catch (PackageManager.NameNotFoundException e) {
app_installed = false;
}
return app_installed;
}
//wechat package name is:::com.tencent.mm
boolean installed = appInstalledOrNot("com.facebook.katana");
if (installed) {
}else{
PackageManager pm = resourcesManager.activity.getPackageManager();
boolean app_installed = false;
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
app_installed = true;
} catch (PackageManager.NameNotFoundException e) {
app_installed = false;
}
return app_installed;
}
//wechat package name is:::com.tencent.mm
boolean installed = appInstalledOrNot("com.facebook.katana");
if (installed) {
}else{
No comments:
Post a Comment