Build 1.0_r1(from source)

android.content.pm
Class ComponentInfo

java.lang.Object
  extended by android.content.pm.PackageItemInfo
      extended by android.content.pm.ComponentInfo
Direct Known Subclasses:
ActivityInfo, ProviderInfo, ServiceInfo

public class ComponentInfo
extends PackageItemInfo

Base class containing information common to all application components (ActivityInfo, ServiceInfo). This class is not intended to be used by itself; it is simply here to share common definitions between all application components. As such, it does not itself implement Parcelable, but does provide convenience methods to assist in the implementation of Parcelable in subclasses.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.content.pm.PackageItemInfo
PackageItemInfo.DisplayNameComparator
 
Field Summary
 ApplicationInfo applicationInfo
          Global information about the application/package this component is a part of.
 boolean enabled
          Indicates whether or not this component may be instantiated.
 boolean exported
          Set to true if this component is available for use by other applications.
 String processName
          The name of the process this component should run in.
 
Fields inherited from class android.content.pm.PackageItemInfo
icon, labelRes, metaData, name, nonLocalizedLabel, packageName
 
Constructor Summary
  ComponentInfo()
           
  ComponentInfo(ComponentInfo orig)
           
protected ComponentInfo(Parcel source)
           
 
Method Summary
protected  void dumpBack(Printer pw, String prefix)
           
protected  void dumpFront(Printer pw, String prefix)
           
 int getIconResource()
          Return the icon resource identifier to use for this component.
 Drawable loadIcon(PackageManager pm)
          Retrieve the current graphical icon associated with this item.
 CharSequence loadLabel(PackageManager pm)
          Retrieve the current textual label associated with this item.
 void writeToParcel(Parcel dest, int parcelableFlags)
           
 
Methods inherited from class android.content.pm.PackageItemInfo
loadXmlMetaData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationInfo

public ApplicationInfo applicationInfo
Global information about the application/package this component is a part of.


processName

public String processName
The name of the process this component should run in. From the "android:process" attribute or, if not set, the same as applicationInfo.processName.


enabled

public boolean enabled
Indicates whether or not this component may be instantiated. Note that this value can be overriden by the one in its parent ApplicationInfo.


exported

public boolean exported
Set to true if this component is available for use by other applications. Comes from android:exported of the <activity>, <receiver>, <service>, or <provider> tag.

Constructor Detail

ComponentInfo

public ComponentInfo()

ComponentInfo

public ComponentInfo(ComponentInfo orig)

ComponentInfo

protected ComponentInfo(Parcel source)
Method Detail

loadLabel

public CharSequence loadLabel(PackageManager pm)
Description copied from class: PackageItemInfo
Retrieve the current textual label associated with this item. This will call back on the given PackageManager to load the label from the application.

Overrides:
loadLabel in class PackageItemInfo
Parameters:
pm - A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item.
Returns:
Returns a CharSequence containing the item's label. If the item does not have a label, its name is returned.

loadIcon

public Drawable loadIcon(PackageManager pm)
Description copied from class: PackageItemInfo
Retrieve the current graphical icon associated with this item. This will call back on the given PackageManager to load the icon from the application.

Overrides:
loadIcon in class PackageItemInfo
Parameters:
pm - A PackageManager from which the icon can be loaded; usually the PackageManager from which you originally retrieved this item.
Returns:
Returns a Drawable containing the item's icon. If the item does not have an icon, the default activity icon is returned.

getIconResource

public final int getIconResource()
Return the icon resource identifier to use for this component. If the component defines an icon, that is used; else, the application icon is used.

Returns:
The icon associated with this component.

dumpFront

protected void dumpFront(Printer pw,
                         String prefix)
Overrides:
dumpFront in class PackageItemInfo

dumpBack

protected void dumpBack(Printer pw,
                        String prefix)
Overrides:
dumpBack in class PackageItemInfo

writeToParcel

public void writeToParcel(Parcel dest,
                          int parcelableFlags)
Overrides:
writeToParcel in class PackageItemInfo

Build 1.0_r1(from source)

Please submit a feedback, bug or feature