/// <summary>Gets the activity or application icon for an activity.</summary>
        /// <remarks>Gets the activity or application icon for an activity.</remarks>
        /// <param name="component">Name of an activity.</param>
        /// <returns>
        /// A drawable, or
        /// <code>null</code>
        /// if neither the acitivy or the application
        /// have an icon set.
        /// </returns>
        private android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName
                                                                   component)
        {
            android.content.pm.PackageManager pm = mContext.getPackageManager();
            android.content.pm.ActivityInfo   activityInfo;
            try
            {
                activityInfo = pm.getActivityInfo(component, android.content.pm.PackageManager.GET_META_DATA
                                                  );
            }
            catch (android.content.pm.PackageManager.NameNotFoundException ex)
            {
                android.util.Log.w(LOG_TAG, ex.ToString());
                return(null);
            }
            int iconId = activityInfo.getIconResource();

            if (iconId == 0)
            {
                return(null);
            }
            string pkg = component.getPackageName();

            android.graphics.drawable.Drawable drawable = pm.getDrawable(pkg, iconId, activityInfo
                                                                         .applicationInfo);
            if (drawable == null)
            {
                android.util.Log.w(LOG_TAG, "Invalid icon resource " + iconId + " for " + component
                                   .flattenToShortString());
                return(null);
            }
            return(drawable);
        }
 /// <summary>Retrieve the current graphical logo associated with this item.</summary>
 /// <remarks>
 /// Retrieve the current graphical logo associated with this item. This
 /// will call back on the given PackageManager to load the logo from
 /// the application.
 /// </remarks>
 /// <param name="pm">
 /// A PackageManager from which the logo can be loaded; usually
 /// the PackageManager from which you originally retrieved this item.
 /// </param>
 /// <returns>
 /// Returns a Drawable containing the item's logo. If the item
 /// does not have a logo, this method will return null.
 /// </returns>
 public virtual android.graphics.drawable.Drawable loadLogo(android.content.pm.PackageManager
                                                            pm)
 {
     if (logo != 0)
     {
         android.graphics.drawable.Drawable d = pm.getDrawable(packageName, logo, getApplicationInfo
                                                                   ());
         if (d != null)
         {
             return(d);
         }
     }
     return(loadDefaultLogo(pm));
 }
 /// <summary>Retrieve the current graphical icon associated with this item.</summary>
 /// <remarks>
 /// Retrieve the current graphical icon associated with this item.  This
 /// will call back on the given PackageManager to load the icon from
 /// the application.
 /// </remarks>
 /// <param name="pm">
 /// A PackageManager from which the icon can be loaded; usually
 /// the PackageManager from which you originally retrieved this item.
 /// </param>
 /// <returns>
 /// Returns a Drawable containing the item's icon.  If the
 /// item does not have an icon, the item's default icon is returned
 /// such as the default activity icon.
 /// </returns>
 public virtual android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager
                                                            pm)
 {
     if (icon != 0)
     {
         android.graphics.drawable.Drawable dr = pm.getDrawable(packageName, icon, getApplicationInfo
                                                                    ());
         if (dr != null)
         {
             return(dr);
         }
     }
     return(loadDefaultIcon(pm));
 }