次阅读 来源:互联网(转载协议) 2016-01-14 10:44 我要评论(0)


extends Object

implements Parcelable Cloneable Comparable<T>



Class Overview

Identifier for a specific application component (Activity,Service,BroadcastReceiver, orContentProvider) that is available. Two pieces of information, encapsulated here, are required to identify a component: the package (a String) it exists in, and the class (a String) name inside of that package.



Inherited Constants

From interface android.os.Parcelable

int CONTENTS_FILE_DESCRIPTOR Bit masks for use with describeContents(): each bit represents a kind of object considered to have potential special significance when marshalled.

int PARCELABLE_WRITE_RETURN_VALUE Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".


public static final Creator<ComponentName> CREATOR

Public Constructors

ComponentName(String pkg, String cls)

Create a new component identifier.

ComponentName(Context pkg, String cls)

Create a new component identifier from a Context and class name.

ComponentName(Context pkg, Class<?> cls)

Create a new component identifier from a Context and Class object.

ComponentName(Parcel in)

Instantiate a new ComponentName from the data in a Parcel that was previously written withwriteToParcel(Parcel, int).

Public Methods

ComponentName clone()

Creates and returns a copy of this Object.

int compareTo(ComponentName that)

int describeContents()

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

boolean equals(Object obj)

Compares this instance with the specified object and indicates if they are equal.

String flattenToShortString()

The same as flattenToString(), but abbreviates the class name if it is a suffix of the package.

String flattenToString()

Return a String that unambiguously describes both the package and class names contained in the ComponentName.

String getClassName()

Return the class name of this component.

String getPackageName()

Return the package name of this component.

String getShortClassName()

Return the class name, either fully qualified or in a shortened form (with a leading '.') if it is a suffix of the package.

int hashCode()

Returns an integer hash code for this object.

static ComponentName readFromParcel(Parcel in)


  • Michael I. Jordan带你解读百万奖金ATEC蚂蚁人工智能大赛

    Michael I. Jordan带你解读百万奖金ATEC蚂蚁人工智能大赛

  • teamLab创始人猪子寿之: 抛去衣食住行,我还剩下什么?

    teamLab创始人猪子寿之: 抛去衣食住行,我还剩下什么?

  • Oculus公布原型机,大幅度提升可视角,能实现140°的视场水平


  • 2018深圳国际人工智能展览会 2018 shenzhen International Artif

    2018深圳国际人工智能展览会 2018 shenzhen International Artif



近日,美国软性机器抓手制造商 Soft Robotics 宣布,获得 2000 万美元的融资,本轮投资者包括 Scale Venture Partners,Calibrate Ventures...

据外媒报道,加州车管局发布了《2017自动驾驶脱离报告(California Autonomous Vehicle Disengagement Reports)》,其中谈及了脱离的具体...