forked from upstream-mirrors/quik
Method for finding out if package is installed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.moez.QKSMS.common.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
public class PackageUtils {
|
||||
|
||||
public static boolean isAppInstalled(Context context, String packageName) {
|
||||
try {
|
||||
context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
|
||||
return true;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user