Fields Summary |
---|
public String | namePublic name of this item. From the "android:name" attribute. |
public String | packageNameName of the package that this item is in. |
public int | labelResA string resource identifier (in the package's resources) of this
component's label. From the "label" attribute or, if not set, 0. |
public CharSequence | nonLocalizedLabelThe string provided in the AndroidManifest file, if any. You
probably don't want to use this. You probably want
{@link PackageManager#getApplicationLabel} |
public int | iconA drawable resource identifier (in the package's resources) of this
component's icon. From the "icon" attribute or, if not set, 0. |
public int | bannerA drawable resource identifier (in the package's resources) of this
component's banner. From the "banner" attribute or, if not set, 0. |
public int | logoA drawable resource identifier (in the package's resources) of this
component's logo. Logos may be larger/wider than icons and are
displayed by certain UI elements in place of a name or name/icon
combination. From the "logo" attribute or, if not set, 0. |
public android.os.Bundle | metaDataAdditional meta-data associated with this component. This field
will only be filled in if you set the
{@link PackageManager#GET_META_DATA} flag when requesting the info. |
public int | showUserIconIf different of UserHandle.USER_NULL, The icon of this item will be the one of that user. |
Methods Summary |
---|
protected void | dumpBack(android.util.Printer pw, java.lang.String prefix)
// no back here
|
protected void | dumpFront(android.util.Printer pw, java.lang.String prefix)
if (name != null) {
pw.println(prefix + "name=" + name);
}
pw.println(prefix + "packageName=" + packageName);
if (labelRes != 0 || nonLocalizedLabel != null || icon != 0 || banner != 0) {
pw.println(prefix + "labelRes=0x" + Integer.toHexString(labelRes)
+ " nonLocalizedLabel=" + nonLocalizedLabel
+ " icon=0x" + Integer.toHexString(icon)
+ " banner=0x" + Integer.toHexString(banner));
}
|
protected ApplicationInfo | getApplicationInfo()Get the ApplicationInfo for the application to which this item belongs,
if available, otherwise returns null.
return null;
|
public android.graphics.drawable.Drawable | loadBanner(PackageManager pm)Retrieve the current graphical banner associated with this item. This
will call back on the given PackageManager to load the banner from
the application.
if (banner != 0) {
Drawable dr = pm.getDrawable(packageName, banner, getApplicationInfo());
if (dr != null) {
return dr;
}
}
return loadDefaultBanner(pm);
|
protected android.graphics.drawable.Drawable | loadDefaultBanner(PackageManager pm)Retrieve the default graphical banner associated with this item.
return null;
|
public android.graphics.drawable.Drawable | loadDefaultIcon(PackageManager pm)Retrieve the default graphical icon associated with this item.
return pm.getDefaultActivityIcon();
|
protected android.graphics.drawable.Drawable | loadDefaultLogo(PackageManager pm)Retrieve the default graphical logo associated with this item.
return null;
|
public android.graphics.drawable.Drawable | loadIcon(PackageManager pm)Retrieve the current graphical icon associated with this item. This
will call back on the given PackageManager to load the icon from
the application.
return pm.loadItemIcon(this, getApplicationInfo());
|
public java.lang.CharSequence | loadLabel(PackageManager pm)Retrieve the current textual label associated with this item. This
will call back on the given PackageManager to load the label from
the application.
if (nonLocalizedLabel != null) {
return nonLocalizedLabel;
}
if (labelRes != 0) {
CharSequence label = pm.getText(packageName, labelRes, getApplicationInfo());
if (label != null) {
return label.toString().trim();
}
}
if (name != null) {
return name;
}
return packageName;
|
public android.graphics.drawable.Drawable | loadLogo(PackageManager pm)Retrieve the current graphical logo associated with this item. This
will call back on the given PackageManager to load the logo from
the application.
if (logo != 0) {
Drawable d = pm.getDrawable(packageName, logo, getApplicationInfo());
if (d != null) {
return d;
}
}
return loadDefaultLogo(pm);
|
public android.graphics.drawable.Drawable | loadUnbadgedIcon(PackageManager pm)Retrieve the current graphical icon associated with this item without
the addition of a work badge if applicable.
This will call back on the given PackageManager to load the icon from
the application.
return pm.loadUnbadgedItemIcon(this, getApplicationInfo());
|
public android.content.res.XmlResourceParser | loadXmlMetaData(PackageManager pm, java.lang.String name)Load an XML resource attached to the meta-data of this item. This will
retrieved the name meta-data entry, and if defined call back on the
given PackageManager to load its XML file from the application.
if (metaData != null) {
int resid = metaData.getInt(name);
if (resid != 0) {
return pm.getXml(packageName, resid, getApplicationInfo());
}
}
return null;
|
public void | writeToParcel(android.os.Parcel dest, int parcelableFlags)
dest.writeString(name);
dest.writeString(packageName);
dest.writeInt(labelRes);
TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
dest.writeInt(icon);
dest.writeInt(logo);
dest.writeBundle(metaData);
dest.writeInt(banner);
dest.writeInt(showUserIcon);
|