package com.ucarhu.demo.util;

import android.content.Context;
import android.content.pm.PackageInfo;
import java.util.List;

public class PackageUtil {
    public static boolean isInstalled(Context context, String str) {
        List<PackageInfo> installedPackages = context.getPackageManager().getInstalledPackages(0);
        if (installedPackages != null) {
            for (PackageInfo packageInfo : installedPackages) {
                if (packageInfo.packageName.equals(str)) {
                    return true;
                }
            }
        }
        return false;
    }
}
