Added in API level 1

PackageItemInfo


open class PackageItemInfo
kotlin.Any
   ↳ android.content.pm.PackageItemInfo

Base class containing information common to all package items held by the package manager. This provides a very common basic set of attributes: a label, icon, and meta-data. This class is not intended to be used by itself; it is simply here to share common definitions between all items returned by the package manager. As such, it does not itself implement Parcelable, but does provide convenience methods to assist in the implementation of Parcelable in subclasses.

Summary

Nested classes
open

Public constructors

Protected constructors

Public methods
open Drawable!

Retrieve the current graphical banner associated with this item.

open Drawable!

Retrieve the current graphical icon associated with this item.

open CharSequence

Retrieve the current textual label associated with this item.

open Drawable!

Retrieve the current graphical logo associated with this item.

open Drawable!

Retrieve the current graphical icon associated with this item without the addition of a work badge if applicable.

open XmlResourceParser!

Load an XML resource attached to the meta-data of this item.

open Unit
writeToParcel(dest: Parcel!, parcelableFlags: Int)

Protected methods
open Unit
dumpBack(pw: Printer!, prefix: String!)

open Unit
dumpFront(pw: Printer!, prefix: String!)

Properties
Int

A drawable resource identifier (in the package's resources) of this component's banner.

Int

A drawable resource identifier (in the package's resources) of this component's icon.

Boolean

Whether the package is currently in an archived state.

Int

A string resource identifier (in the package's resources) of this component's label.

Int

A drawable resource identifier (in the package's resources) of this component's logo.

Bundle!

Additional meta-data associated with this component.

String!

Public name of this item.

CharSequence!

The string provided in the AndroidManifest file, if any.

String!

Name of the package that this item is in.

Public constructors

PackageItemInfo

Added in API level 1
PackageItemInfo()

PackageItemInfo

Added in API level 1
PackageItemInfo(orig: PackageItemInfo!)

Protected constructors

PackageItemInfo

Added in API level 1
protected PackageItemInfo(source: Parcel!)

Public methods

loadBanner

Added in API level 20
open fun loadBanner(pm: PackageManager!): Drawable!

Retrieve the current graphical banner associated with this item. This will call back on the given PackageManager to load the banner from the application.

Parameters
pm PackageManager!: A PackageManager from which the banner can be loaded; usually the PackageManager from which you originally retrieved this item.
Return
Drawable! Returns a Drawable containing the item's banner. If the item does not have a banner, this method will return null.

loadIcon

Added in API level 1
open fun loadIcon(pm: PackageManager!): Drawable!

Retrieve the current graphical icon associated with this item. This will call back on the given PackageManager to load the icon from the application.

Parameters
pm PackageManager!: A PackageManager from which the icon can be loaded; usually the PackageManager from which you originally retrieved this item.
Return
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

Added in API level 1
open fun loadLabel(pm: PackageManager): CharSequence

Retrieve the current textual label associated with this item. This will call back on the given PackageManager to load the label from the application.

Parameters
pm PackageManager: A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item. This value cannot be null.
Return
CharSequence Returns a CharSequence containing the item's label. If the item does not have a label, its name is returned. This value cannot be null.
Added in API level 9
open fun loadLogo(pm: PackageManager!): Drawable!

Retrieve the current graphical logo associated with this item. This will call back on the given PackageManager to load the logo from the application.

Parameters
pm PackageManager!: A PackageManager from which the logo can be loaded; usually the PackageManager from which you originally retrieved this item.
Return
Drawable! Returns a Drawable containing the item's logo. If the item does not have a logo, this method will return null.

loadUnbadgedIcon

Added in API level 22
open fun loadUnbadgedIcon(pm: PackageManager!): Drawable!

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.

Parameters
pm PackageManager!: A PackageManager from which the icon can be loaded; usually the PackageManager from which you originally retrieved this item.
Return
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

Added in API level 1
open fun loadXmlMetaData(
    pm: PackageManager!,
    name: String!
): XmlResourceParser!

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.

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.
Return
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

Added in API level 1
open fun writeToParcel(
    dest: Parcel!,
    parcelableFlags: Int
): Unit

Protected methods

dumpBack

Added in API level 1
protected open fun dumpBack(
    pw: Printer!,
    prefix: String!
): Unit

dumpFront

Added in API level 1
protected open fun dumpFront(
    pw: Printer!,
    prefix: String!
): Unit

Properties

Added in API level 20
var banner: Int

A drawable resource identifier (in the package's resources) of this component's banner. From the "banner" attribute or, if not set, 0.

icon

Added in API level 1
var icon: Int

A drawable resource identifier (in the package's resources) of this component's icon. From the "icon" attribute or, if not set, 0.

isArchived

Added in API level 35
var isArchived: Boolean

Whether the package is currently in an archived state.

Packages can be archived through PackageInstaller#requestArchive and do not have any APKs stored on the device, but do keep the data directory.

labelRes

Added in API level 1
var labelRes: Int

A string resource identifier (in the package's resources) of this component's label. From the "label" attribute or, if not set, 0.

Added in API level 9
var logo: Int

A 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.

metaData

Added in API level 1
var metaData: Bundle!

Additional meta-data associated with this component. This field will only be filled in if you set the PackageManager#GET_META_DATA flag when requesting the info.

name

Added in API level 1
var name: String!

Public name of this item. From the "android:name" attribute.

nonLocalizedLabel

Added in API level 1
var nonLocalizedLabel: CharSequence!

The string provided in the AndroidManifest file, if any. You probably don't want to use this. You probably want PackageManager#getApplicationLabel

packageName

Added in API level 1
var packageName: String!

Name of the package that this item is in.