I want to use an icon from an icon pack. I know how to find installed icon packs. But I can't find out how to load an icon from an icon pack.

**Find icon packs - WORKS**

That's how I find icon packs:

```
private static ArrayList<String> getInstalledIconPacks(String filter)
{
    ArrayList<String> packs = new ArrayList<>();

    List<ResolveInfo> infos = MainApp.get().getPackageManager().queryIntentActivities(new Intent(filter), PackageManager.GET_META_DATA);
    if (infos != null)
    {
        for (int i = 0; i < infos.size(); i++)
        {
            ActivityInfo activity = infos.get(i).activityInfo;
            String packageName = activity.packageName;
            if (packageName != null)
                packs.add(packageName);
        }
    }

    return packs;
}

```

Now the user can select an icon pack. I then try to load an icon from an icon pack like following:

**Load icon for app from icon pack - DOES NOT WORK**

```
public static Drawable getIconPackIcon(String packageName)
{
    L.d(AppUtil.class, "PackageName: " + packageName);

    String componentName = MainApp.get().getPackageManager().getLaunchIntentForPackage(packageName).getComponent().toString();
    L.d(AppUtil.class, "componentName: " + componentName);

    try
    {
        //Resources res = MainApp.get().getResources();
        Resources res = MainApp.get().getPackageManager().getResourcesForApplication(packageName);
        int identifier = res.getIdentifier(componentName, "drawable", packageName);
        L.d(AppUtil.class, "identifier: " + identifier);

        if (identifier == 0)
            return null;

        Drawable d = res.getDrawable(identifier);
        L.d(AppUtil.class, "d: " + d);

        return d;
    } 
    catch (PackageManager.NameNotFoundException e) 
    {
        L.e(AppUtil.class, e);
        return null;
    }
}

```

But the identifier is always 0. I don't know how to do it correctly...

For example, I know WhatsApp is in the icon pack. My debug output for it is:

```
PackageName: com.whatsapp
componentName: ComponentInfo{com.whatsapp/com.whatsapp.Main}
identifier: 0

```