public static Drawable loadIconByPkgName(Context context, String pkg) {
        PackageManager pm = context.getPackageManager();
        try {
            ApplicationInfo info = pm.getApplicationInfo(pkg, PackageManager.GET_UNINSTALLED_PACKAGES);
            if (info == null) return null;
            return info.loadIcon(pm);
        } catch (Throwable e) {
            XLog.e("loadIconByPkgName error", e);
            return null;
        }
    }
Created by Nick@NewStand.org on 2017/3/13 9:56
E-Mail: NewStand@163.com
All right reserved.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/ApkUtil.java