MonkeyRunner-ComponentNameextends Objectimplements Parcelable Cloneable Comparable for Android automated testing <T> java. lang. object upload android. content. componentNameClass OverviewIdentifier 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 I N, and the class (a String) name inside of that package. summary [Expand] Inherited ConstantsFrom interface android. OS. parcelableint into Bit masks for use with counter (): each bit represents a kind of object considered to have potential special significance when your alled.int Flag for use with writeToParcel (Parcel, int ): the object being wr Itten is a return value, that is the result of a function such as "Parcelable someFunction ()", "void someFunction (out Parcelable)", or "void someFunction (inout Parcelable) ". fieldspublic static final Creator <ComponentName> CREATOR Public ConstructorsComponentName (String pkg, String cls) Create a new component identifier. componentName (Context pkg, String cls) Create a new component identifier from a C Ontext 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 previusly written withwriteToParcel (Parcel, int ). public MethodsComponentName clone () Creates and returns a copy of this Object.int compareTo (ComponentName that) int describeContents () Describe the kinds of special objects contained in this P Arcelable's unsupported alled 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 ComponentNam E. string getClassName () Return the class name of this component. string getPackageName () Return the package name of this component. string getaskclassname () 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) Read a ComponentNa Me from a Parcel that was previusly written withwriteToParcel (ComponentName, Parcel), returning either a null or new object as appropriate. string toShortString () Return string representation of this class without the class's name as a prefix. string toString () Returns a string containing a concise, human-readable description of this object. static ComponentName unflattenFromString (String str) Recover A ComponentName from a String that was previusly created withflattenToString (). void writeToParcel (Parcel out, int flags) Flatten this object in to a Parcel. static void writeToParcel (ComponentName c, Parcel out) Write a ComponentName to a Parcel, handling null pointers. [Expand] Inherited Methods From class java. lang. objectObject clone () Creates and returns a copy of this Object. boolean equals (Object o) Compares this instance with the specified object and indicates if they are equal. void finalize () Invoked when the garbage collector has detected that this instance is no longer reachable. final Class <?> GetClass () Returns the unique instance of Class that represents this object's class.int hashCode () Returns an integer hash code for this object. final void Policy () Causes a thread which is waiting on this object's monitor (by means of calling one of thewait () methods) to be woken up. final void policyall () Causes all threads which are waiting on this object's monitor (by means of calling one of thewait () Methods) to be woken up. string toString () Returns a string containing a concise, human-readable description of this object. final void wait () Causes the calling thread to wait until another thread CILS thenotify () orpolicyall () method of this object. final void wait (long millis, int nanos) Causes the calling thread to wait until another thread CILS thenovel () orpolicyall () method of this object o R until the specified timeout expires. final void wait (long millis) Causes the calling thread to wait until another thread CILS thenotify () orpolicyall () method of this object or until the specified timeout expires. from interface android. OS. parcelableabstract int describeContents () Describe the kinds of special objects contained in this Parcelable's stored alled representation. abstract void writeToPa Rcel (Parcel dest, int flags) Flatten this object in to a Parcel. from interface java. lang. comparableabstract int compareTo (T another) Compares this object to the specified object to determine their relative order. fieldspublic static final Creator <ComponentName> CREATORAdded in API level 1 Public Constructorspublic ComponentName (String pkg, String cls) Added in API level 1 Create a new component identifie R. parameterspkg The name of the package that the component exists in. can not be null. cls The name of the class inside of pkg that implements the component. can not be null. public ComponentName (Context pkg, String cls) Added in API level 1 Create a new component identifier from a Context and class name. parameterspkg A Context for the package implementing the component, from which the actual package n Ame will be retrieved. cls The name of the class inside of pkg that implements the component. public ComponentName (Context pkg, Class <?> Cls) Added in API level 1 Create a new component identifier from a Context and Class object. parameterspkg A Context for the package implementing the component, from which the actual package name will be retrieved. cls The Class object of the desired component, from which the actual class name will be retrieved. public ComponentName (Parcel in) Added in API level 1 Instantiate a new ComponentName from the data in a Parcel that was previusly written withwriteToParcel (Parcel, int ). note that you must not use this with data written bywriteToParcel (ComponentName, Parcel) since it is not possible to handle a null ComponentObject here. parametersin The Parcel containing the previusly written ComponentName, positioned at the location in the buffer where it was written. public Methodspublic ComponentName clone () Added in API level 1 Creates and returns a copy of this Object. the default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, wocould also recursively clone nested objects. A subclass that needs to implement this kind of cloning shoshould callsuper. clone () to create the new instance and then create deep copies of the nested, mutable objects. returnsa copy of this object. public int compareTo (ComponentName that) Added in API level 4 public int describeContents () Added in API level 1 Describe the kinds of special objects contained in this Parcelable's unsupported alled representation. returnsa bitmask indicating the set of special object types stored alled by the Parcelable. public boolean equals (Object obj) Added in API level 1 Compares this instance with the specified object and indicates if they are equal. in order to be equal, o must represent the same object as this instance using a class-specific comparison. the general contract is that this comparison shoshould be reflexive, distance Ric, and transitive. also, no object reference other than null is equal to null. the default implementation returns true only if this = o. seeWriting a correctequals method if you intend implementing your ownequals method. the general contract for the equals and hashCode () methods is that ifequals returnstrue for any two objects, thenhashCode () must return the same value for these objects. this means that subclasses ofObject usually override either both methods or neither of them. parametersobj the object to compare this instance. returnstrue if the specified object is equal to this Object; false otherwise. public String flattenToShortString () Added in API level 1The same as flattenToString (), but abbreviates the class name if it is a suffix of the package. the result can still be used withunflattenFromString (String ). returnsReturns a new String holding the package and class names. this is represented as the package name, concatenated with a'/'and then the class name. see AlsounflattenFromString (String) public String flattenToString () Added in API level 1 Return a String that unambiguously describes both the package and class names contained in the ComponentName. you can later recover the ComponentName from this string throughunflattenFromString (String ). returnsReturns a new String holding the package and class names. this is represented as the package name, concatenated with a'/'and then the class name. see AlsounflattenFromString (String) public String getClassName () Added in API level 1 Return the class name of this component. public String getPackageName () Added in API level 1 Return the package name of this component. public String getaskclassname () Added in API level 1 Return the class name, either fully qualified or in a shortened form (with a leading '. ') if it is a suffix of the package. public int hashCode () Added in API level 1 Returns an integer hash code for this object. by contract, any two objects for whichequals (Object) returnstrue must return the same hash code value. this means that subclasses ofObject usually override both methods or neither method. note that hash values must not change over time unless information used in equals comparisons also changes. see Writing a correct hashCode method if you intend implementing your ownhashCode method. returnsthis object's hash code. public static ComponentName readFromParcel (Parcel in) Added in API level 1 Read a ComponentName from a Parcel that was previusly written with writeToParcel (ComponentName, Parcel ), returning either a null or new object as appropriate. parametersin The Parcel from which to read the ComponentNameReturnsReturns a new ComponentName matching the previusly written object, or null if a null had been written. see AlsowriteToParcel (ComponentName, Parcel) public String tow.string () Added in API level 1 Return string representation of this class without the class's name as a prefix. public String toString () Added in API level 1 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 is equivalent to the following expression: getClass (). getName () + '@' + Integer. toHexString (hashCode () See Writing a useful toString method if you intend implementing your owntoString method. returnsa printable representation of this object. public static ComponentName unflattenFromString (String str) Added in API level 1 Recover a ComponentName from a String that was previusly created with flattenToString (). it splits the string at the first '/', taking the part before as the package name and the part after as the class name. as a special convenience (to use, for example, when parsing component names on the command line), if the '/' is immediately followed by '. 'Then the final class name will be the concatenation of the package name with the string following '/'. thus "com. foo /. blah "becomes package =" com. foo "class =" com. foo. blah ". parametersstr The String that was returned by flattenToString (). returnsReturns a new ComponentName containing the package and class names that were encoded into see partition () public void writeToParcel (Parcel out, int flags) Added in API level 1 Flatten this object in to a Parcel. parametersout The Parcel in which the object shocould be written. flags Additional flags about how the object should be written. may be 0 or PARCELABLE_WRITE_RETURN_VALUE.public static void writeToParcel (ComponentName c, Parcel out) Added in API level 1 Write a ComponentName to a Parcel, handling null pointers. must be read with readFromParcel (Parcel ). parametersc The ComponentName to be written. out The Parcel in which the ComponentName will be placed. see AlsoreadFromParcel (Parcel)