code: private Drawable getActivityIcon(ComponentName component) {
          PackageManager pm = mContext.getPackageManager();
          final ActivityInfo activityInfo;
          try {
              activityInfo = pm.getActivityInfo(component, PackageManager.GET_META_DATA);
          } catch (NameNotFoundException ex) {
              Log.w(LOG_TAG, ex.toString());
              return null;
          }
          int iconId = activityInfo.getIconResource();
          if (iconId == 0) return null;
          String pkg = component.getPackageName();
          Drawable drawable = pm.getDrawable(pkg, iconId, activityInfo.applicationInfo);
          if (drawable == null) {
              Log.w(LOG_TAG, "Invalid icon resource " + iconId + " for "
                      + component.flattenToShortString());
              return null;
          }
          return drawable;
      }
docs: Gets the activity or application icon for an activity.
  
  @param component Name of an activity.
  @return A drawable, or {@code null} if neither the acitivy or the application
  have an icon set.