public final class InputMethodInfo extends Object implements Parcelable
It should be defined in an XML resource file with an <input-method>
element.
For more information, see the guide to
Creating an Input Method.
InputMethodSubtype
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<InputMethodInfo> |
CREATOR
Used to make this class parcelable.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
InputMethodInfo(Context context,
ResolveInfo service)
Constructor.
|
InputMethodInfo(Context context,
ResolveInfo service,
Map<String,List<InputMethodSubtype>> additionalSubtypesMap)
Constructor.
|
InputMethodInfo(ResolveInfo ri,
boolean isAuxIme,
String settingsActivity,
List<InputMethodSubtype> subtypes,
int isDefaultResId,
boolean forceDefault)
Temporary API for creating a built-in input method for test.
|
InputMethodInfo(ResolveInfo ri,
boolean isAuxIme,
String settingsActivity,
List<InputMethodSubtype> subtypes,
int isDefaultResId,
boolean forceDefault,
boolean supportsSwitchingToNextInputMethod)
Temporary API for creating a built-in input method for test.
|
InputMethodInfo(String packageName,
String className,
CharSequence label,
String settingsActivity)
Temporary API for creating a built-in input method for test.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
void |
dump(Printer pw,
String prefix) |
boolean |
equals(Object o)
Used to test whether the given parameter object is an
InputMethodInfo and its Id is the same to this one. |
ComponentName |
getComponent()
Return the component of the service that implements this input
method.
|
String |
getId()
Return a unique ID for this input method.
|
int |
getIsDefaultResourceId()
Return the resource identifier of a resource inside of this input
method's .apk that determines whether it should be considered a
default input method for the system.
|
String |
getPackageName()
Return the .apk package that implements this input method.
|
ServiceInfo |
getServiceInfo()
Return the raw information about the Service implementing this
input method.
|
String |
getServiceName()
Return the class name of the service component that implements
this input method.
|
String |
getSettingsActivity()
Return the class name of an activity that provides a settings UI for
the input method.
|
InputMethodSubtype |
getSubtypeAt(int index)
Return the Input Method's subtype at the specified index.
|
int |
getSubtypeCount()
Return the count of the subtypes of Input Method.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isAuxiliaryIme() |
boolean |
isDefault(Context context)
Return whether or not this ime is a default ime or not.
|
Drawable |
loadIcon(PackageManager pm)
Load the user-displayed icon for this input method.
|
CharSequence |
loadLabel(PackageManager pm)
Load the user-displayed label for this input method.
|
boolean |
supportsSwitchingToNextInputMethod() |
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Used to package this object into a
Parcel . |
public static final Parcelable.Creator<InputMethodInfo> CREATOR
public InputMethodInfo(Context context, ResolveInfo service) throws XmlPullParserException, IOException
context
- The Context in which we are parsing the input method.service
- The ResolveInfo returned from the package manager about
this input method's component.XmlPullParserException
IOException
public InputMethodInfo(Context context, ResolveInfo service, Map<String,List<InputMethodSubtype>> additionalSubtypesMap) throws XmlPullParserException, IOException
context
- The Context in which we are parsing the input method.service
- The ResolveInfo returned from the package manager about
this input method's component.additionalSubtypesMap
- additional subtypes being added to this InputMethodInfoXmlPullParserException
IOException
public InputMethodInfo(String packageName, String className, CharSequence label, String settingsActivity)
public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault)
public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod)
public String getId()
public String getPackageName()
public String getServiceName()
public ServiceInfo getServiceInfo()
public ComponentName getComponent()
public CharSequence loadLabel(PackageManager pm)
pm
- Supply a PackageManager used to load the input method's
resources.public Drawable loadIcon(PackageManager pm)
pm
- Supply a PackageManager used to load the input method's
resources.public String getSettingsActivity()
Intent
whose action is MAIN and with an
explicit ComponentName
composed of getPackageName()
and the class name returned here.
A null will be returned if there is no settings activity associated with the input method.
public int getSubtypeCount()
public InputMethodSubtype getSubtypeAt(int index)
index
- the index of the subtype to return.public int getIsDefaultResourceId()
public boolean isDefault(Context context)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public boolean equals(Object o)
InputMethodInfo
and its Id is the same to this one.equals
in class Object
o
- the reference object with which to compare.InputMethodInfo
and its Id is the same to this one.Object.hashCode()
,
HashMap
public int hashCode()
Object
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
JavaTM programming language.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean isAuxiliaryIme()
public boolean supportsSwitchingToNextInputMethod()
public void writeToParcel(Parcel dest, int flags)
Parcel
.writeToParcel
in interface Parcelable
dest
- The Parcel
to be written.flags
- The flags used for parceling.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR