類ApplicationInfo詳解

包android.content.pm
 

java.lang.Object

  android.content.pm.PackageItemInfo

      android.content.pm.ApplicationInfo

所有已實現的接口:

Parcelable

 

public class ApplicationInfo

extends PackageItemInfo

implements Parcelable

Information you can retrieve about a particular application. This corresponds to information collected from the AndroidManifest.xml's <application> tag.

 

嵌套類摘要

static class

ApplicationInfo.DisplayNameComparator 
           

 

從接口 android.os.Parcelable 繼承的嵌套類/接口

Parcelable.Creator<T>

 

字段摘要

 String

className 
          Class implementing the Application object.

static Parcelable.Creator<ApplicationInfo>

CREATOR 
           

 String

dataDir 
          Full path to a directory assigned to the package for its persistent data.

 int

descriptionRes 
          A style resource identifier (in the package's resources) of the description of an application.

 boolean

enabled 
          When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.

static int

FLAG_ALLOW_CLEAR_USER_DATA 
          Value for flags: default value for the corresponding ActivityInfo flag.

static int

FLAG_ALLOW_TASK_REPARENTING 
          Value for flags: default value for the corresponding ActivityInfo flag.

static int

FLAG_DEBUGGABLE 
          Value for flags: set to true if this application would like to allow debugging of its code, even when installed on a non-development system.

static int

FLAG_FACTORY_TEST 
          Value for flags: set to true iif this application holds the android.Manifest.permission#FACTORY_TEST permission and the device is running in factory test mode.

static int

FLAG_HAS_CODE 
          Value for flags: set to true if this application has code associated with it.

static int

FLAG_PERSISTENT 
          Value for flags: set to true if this application is persistent.

static int

FLAG_SYSTEM 
          Value for flags: if set, this application is installed in the device's system image.

static int

FLAG_UPDATED_SYSTEM_APP 
          Value for flags: default value for the corresponding ActivityInfo flag.

 int

flags 
          Flags associated with the application.

 String

manageSpaceActivityName 
          Class implementing the Application's manage space functionality.

 String

permission 
          Optional name of a permission required to be able to access this application's components.

 String

processName 
          The name of the process this application should run in.

 String

publicSourceDir 
          Full path to the location of the publicly available parts of this package (i.e. the resources and manifest).

 String[]

sharedLibraryFiles 
          Paths to all shared libraries this application is linked against.

 String

sourceDir 
          Full path to the location of this package.

 String

taskAffinity 
          Default task affinity of all activities in this application.

 int

theme 
          A style resource identifier (in the package's resources) of the default visual theme of the application.

 int

uid 
          The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).

 

從類 android.content.pm.PackageItemInfo 繼承的字段

icon, labelRes, metaData, name, nonLocalizedLabel, packageName

 

從接口 android.os.Parcelable 繼承的字段

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

 

構造方法摘要

ApplicationInfo() 
           

 

ApplicationInfo(ApplicationInfo orig) 
           

 

 

方法摘要

 int

describeContents() 
          Describe the kinds of special objects contained in this Parcelable's marshalled representation.

 void

dump(Printer pw, String prefix) 
           

 CharSequence

loadDescription(PackageManager pm) 
          Retrieve the textual description of the application.

 String

toString() 
          Returns a string containing a concise, human-readable description of this object.

 void

writeToParcel(Parcel dest, int parcelableFlags) 
          Flatten this object in to a Parcel.

 

從類 android.content.pm.PackageItemInfo 繼承的方法

loadIcon, loadLabel, loadXmlMetaData

 

從類 java.lang.Object 繼承的方法

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

字段詳細信息

taskAffinity

public String taskAffinity

Default task affinity of all activities in this application. See ActivityInfo.taskAffinity for more information. This comes from the "taskAffinity" attribute.

 

permission

public String permission

Optional name of a permission required to be able to access this application's components. From the "permission" attribute.

 

processName

public String processName

The name of the process this application should run in. From the "process" attribute or, if not set, the same as packageName.

 

className

public String className

Class implementing the Application object. From the "class" attribute.

 

descriptionRes

public int descriptionRes

A style resource identifier (in the package's resources) of the description of an application. From the "description" attribute or, if not set, 0.

 

theme

public int theme

A style resource identifier (in the package's resources) of the default visual theme of the application. From the "theme" attribute or, if not set, 0.

 

manageSpaceActivityName

public String manageSpaceActivityName

Class implementing the Application's manage space functionality. From the "manageSpaceActivity" attribute. This is an optional attribute and will be null if application's dont specify it in their manifest

 

FLAG_SYSTEM

public static final int FLAG_SYSTEM

Value for flags: if set, this application is installed in the device's system image.

另請參見:

常量字段值

 

FLAG_DEBUGGABLE

public static final int FLAG_DEBUGGABLE

Value for flags: set to true if this application would like to allow debugging of its code, even when installed on a non-development system. Comes from android:debuggableof the <application> tag.

另請參見:

常量字段值

 

FLAG_HAS_CODE

public static final int FLAG_HAS_CODE

Value for flags: set to true if this application has code associated with it. Comes from android:hasCode of the <application> tag.

另請參見:

常量字段值

 

FLAG_PERSISTENT

public static final int FLAG_PERSISTENT

Value for flags: set to true if this application is persistent. Comes from android:persistent of the <application> tag.

另請參見:

常量字段值

 

FLAG_FACTORY_TEST

public static final int FLAG_FACTORY_TEST

Value for flags: set to true iif this application holds the android.Manifest.permission#FACTORY_TEST permission and the device is running in factory test mode.

另請參見:

常量字段值

 

FLAG_ALLOW_TASK_REPARENTING

public static final int FLAG_ALLOW_TASK_REPARENTING

Value for flags: default value for the corresponding ActivityInfo flag. Comes from android:allowTaskReparenting of the <application> tag.

另請參見:

常量字段值

 

FLAG_ALLOW_CLEAR_USER_DATA

public static final int FLAG_ALLOW_CLEAR_USER_DATA

Value for flags: default value for the corresponding ActivityInfo flag. Comes from android:allowClearUserData of the <application> tag.

另請參見:

常量字段值

 

FLAG_UPDATED_SYSTEM_APP

public static final int FLAG_UPDATED_SYSTEM_APP

Value for flags: default value for the corresponding ActivityInfo flag.

另請參見:

常量字段值

 

flags

public int flags

Flags associated with the application. Any combination of FLAG_SYSTEM, FLAG_DEBUGGABLE, FLAG_HAS_CODE, FLAG_PERSISTENT, FLAG_FACTORY_TEST, and FLAG_ALLOW_TASK_REPARENTING FLAG_ALLOW_CLEAR_USER_DATA.

 

sourceDir

public String sourceDir

Full path to the location of this package.

 

publicSourceDir

public String publicSourceDir

Full path to the location of the publicly available parts of this package (i.e. the resources and manifest). For non-forward-locked apps this will be the same as {@link #sourceDir).

 

sharedLibraryFiles

public String[] sharedLibraryFiles

Paths to all shared libraries this application is linked against. This field is only set if the PackageManager.GET_SHARED_LIBRARY_FILES flag was used when retrieving the structure.

 

dataDir

public String dataDir

Full path to a directory assigned to the package for its persistent data.

 

uid

public int uid

The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).

 

enabled

public boolean enabled

When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.

 

CREATOR

public static final Parcelable.Creator<ApplicationInfo> CREATOR

構造方法詳細信息

ApplicationInfo

public ApplicationInfo()

 

ApplicationInfo

public ApplicationInfo(ApplicationInfo orig)

方法詳細信息

dump

public void dump(Printer pw,

                 String prefix)

 

toString

public String toString()

從類 Object 複製的描述

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's Object.hashCode(), that is, it is equivalent to the following expression:

 getClass().getName() + '@' + Integer.toHexString(hashCode())

 

覆蓋:

類 Object 中的 toString

返回:

a printable representation of this object.

 

describeContents

public int describeContents()

從接口 Parcelable 複製的描述

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

指定者:

接口 Parcelable 中的 describeContents

返回:

a bitmask indicating the set of special object types marshalled by the Parcelable.

 

writeToParcel

public void writeToParcel(Parcel dest,

                          int parcelableFlags)

從接口 Parcelable 複製的描述

Flatten this object in to a Parcel.

指定者:

接口 Parcelable 中的 writeToParcel

覆蓋:

類 PackageItemInfo 中的 writeToParcel

參數:

dest - The Parcel in which the object should be written.

parcelableFlags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.

 

loadDescription

public CharSequence loadDescription(PackageManager pm)

Retrieve the textual description of the application. Thiswill call back on the given PackageManager to load the description fromthe application.

參數:

pm - A PackageManager from which the label can be loaded; usuallythe PackageManager from which you originally retrieved this item.

返回:

Returns a CharSequence containing the application's description.If there is no description, null is returned.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章