PackageItemInfo
public class PackageItemInfo
extends Object
Known Direct Subclasses
|
Known Indirect Subclasses
|
包含包管理器保存的所有包项的公共信息的基类。 这提供了一组非常常见的基本属性:标签,图标和元数据。 本课程不打算单独使用; 只是在这里共享包管理器返回的所有项目之间的通用定义。 因此,它本身并不实现Parcelable,但确实提供了便利的方法来帮助在子类中实现Parcelable。
Summary
Fields
banner
int banner
此组件横幅的可绘制资源标识符(位于软件包资源中)。 从“banner”属性或者如果未设置,则为0。
icon
int icon
此组件图标的可绘制资源标识符(位于程序包的资源中)。 从“图标”属性或如果未设置,则为0。
labelRes
int labelRes
此组件标签的字符串资源标识符(位于程序包的资源中)。 从“标签”属性或如果未设置,则为0。
logo
int logo
此组件徽标的可绘制资源标识符(位于程序包的资源中)。 徽标可能比图标更大/更宽,并且由某些UI元素代替名称或名称/图标组合显示。 从“徽标”属性或者如果未设置,则为0。
name
String name
这个项目的公开名称。 从“android:name”属性。
packageName
String packageName
该项目所在的包的名称。
Public constructors
PackageItemInfo
PackageItemInfo ()
PackageItemInfo
PackageItemInfo (PackageItemInfo orig)
Parameters |
orig |
PackageItemInfo
|
Protected constructors
PackageItemInfo
PackageItemInfo (Parcel source)
Public methods
loadBanner
Drawable loadBanner (PackageManager pm)
检索与此项目关联的当前图形横幅。 这将回调给定的PackageManager从应用程序加载横幅。
Parameters |
pm |
PackageManager : A PackageManager from which the banner can be loaded; usually the PackageManager from which you originally retrieved this item. |
Returns |
Drawable |
Returns a Drawable containing the item's banner. If the item does not have a banner, this method will return null. |
loadIcon
Drawable loadIcon (PackageManager pm)
检索与此项目关联的当前图形图标。 这将回调给定的PackageManager从应用程序加载图标。
Parameters |
pm |
PackageManager : A PackageManager from which the icon can be loaded; usually the PackageManager from which you originally retrieved this item. |
Returns |
Drawable |
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. |
loadLabel
CharSequence loadLabel (PackageManager pm)
检索与该项目相关的当前文本标签。 这将回调给定的PackageManager从应用程序加载标签。
Parameters |
pm |
PackageManager : A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item. |
Returns |
CharSequence |
Returns a CharSequence containing the item's label. If the item does not have a label, its name is returned. |
loadLogo
Drawable loadLogo (PackageManager pm)
检索与此项目关联的当前图形徽标。 这将回调给定的PackageManager从应用程序加载徽标。
Parameters |
pm |
PackageManager : A PackageManager from which the logo can be loaded; usually the PackageManager from which you originally retrieved this item. |
Returns |
Drawable |
Returns a Drawable containing the item's logo. If the item does not have a logo, this method will return null. |
loadUnbadgedIcon
Drawable loadUnbadgedIcon (PackageManager pm)
检索与该项目关联的当前图形图标,而不添加工作标志(如果适用)。 这将回调给定的PackageManager从应用程序加载图标。
Parameters |
pm |
PackageManager : A PackageManager from which the icon can be loaded; usually the PackageManager from which you originally retrieved this item. |
Returns |
Drawable |
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. |
loadXmlMetaData
XmlResourceParser loadXmlMetaData (PackageManager pm,
String name)
加载附加到该项目的元数据的XML资源。 这将检索名称元数据条目,并且如果在给定的PackageManager上定义回调以从应用程序加载其XML文件。
Parameters |
pm |
PackageManager : A PackageManager from which the XML can be loaded; usually the PackageManager from which you originally retrieved this item. |
name |
String : Name of the meta-date you would like to load. |
Returns |
XmlResourceParser |
Returns an XmlPullParser you can use to parse the XML file assigned as the given meta-data. If the meta-data name is not defined or the XML resource could not be found, null is returned. |
writeToParcel
void writeToParcel (Parcel dest,
int parcelableFlags)
Parameters |
dest |
Parcel
|
parcelableFlags |
int
|
Protected methods
dumpBack
void dumpBack (Printer pw,
String prefix)
Parameters |
pw |
Printer
|
prefix |
String
|
dumpFront
void dumpFront (Printer pw,
String prefix)
Parameters |
pw |
Printer
|
prefix |
String
|