mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-20 04:48:51 +01:00
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