to top
Android APIs
public final class

InputMethodInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.view.inputmethod.InputMethodInfo

Class Overview

This class is used to specify meta information of an input method.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<InputMethodInfo> CREATOR Used to make this class parcelable.
Public Constructors
InputMethodInfo(Context context, ResolveInfo service)
Constructor.
InputMethodInfo(String packageName, String className, CharSequence label, String settingsActivity)
Temporary API for creating a built-in input method.
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled 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 an integer hash code for this object.
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.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Used to package this object into a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<InputMethodInfo> CREATOR

Added in API level 3

Used to make this class parcelable.

Public Constructors

public InputMethodInfo (Context context, ResolveInfo service)

Added in API level 3

Constructor.

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

public InputMethodInfo (String packageName, String className, CharSequence label, String settingsActivity)

Added in API level 3

Temporary API for creating a built-in input method.

Public Methods

public int describeContents ()

Added in API level 3

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

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

public void dump (Printer pw, String prefix)

Added in API level 3

public boolean equals (Object o)

Added in API level 3

Used to test whether the given parameter object is an InputMethodInfo and its Id is the same to this one.

Parameters
o the object to compare this instance with.
Returns
  • true if the given parameter object is an InputMethodInfo and its Id is the same to this one.

public ComponentName getComponent ()

Added in API level 3

Return the component of the service that implements this input method.

public String getId ()

Added in API level 3

Return a unique ID for this input method. The ID is generated from the package and class name implementing the method.

public int getIsDefaultResourceId ()

Added in API level 3

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.

public String getPackageName ()

Added in API level 3

Return the .apk package that implements this input method.

public ServiceInfo getServiceInfo ()

Added in API level 3

Return the raw information about the Service implementing this input method. Do not modify the returned object.

public String getServiceName ()

Added in API level 3

Return the class name of the service component that implements this input method.

public String getSettingsActivity ()

Added in API level 3

Return the class name of an activity that provides a settings UI for the input method. You can launch this activity be starting it with an 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 InputMethodSubtype getSubtypeAt (int index)

Added in API level 11

Return the Input Method's subtype at the specified index.

Parameters
index the index of the subtype to return.

public int getSubtypeCount ()

Added in API level 11

Return the count of the subtypes of Input Method.

public int hashCode ()

Added in API level 3

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object 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 own hashCode method.

Returns
  • this object's hash code.

public Drawable loadIcon (PackageManager pm)

Added in API level 3

Load the user-displayed icon for this input method.

Parameters
pm Supply a PackageManager used to load the input method's resources.

public CharSequence loadLabel (PackageManager pm)

Added in API level 3

Load the user-displayed label for this input method.

Parameters
pm Supply a PackageManager used to load the input method's resources.

public String toString ()

Added in API level 3

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 own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 3

Used to package this object into a Parcel.

Parameters
dest The Parcel to be written.
flags The flags used for parceling.