private boolean isAppExist() {
PackageManager pm = getPackageManager();
try {
PackageInfo info = pm.getPackageInfo("com.facebook.katana", PackageManager.GET_META_DATA);
} catch (PackageManager.NameNotFoundException e) {
return false;
}
return true;
}
if (isFacebookExist()) {showToast(" Facebook is install.");}
else {showToast(" Facebook is not install.");}