Skip to content

Most visited

Recently visited

navigation
Added in API level 3

InputMethodInfo

public final class InputMethodInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.view.inputmethod.InputMethodInfo


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

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.

See also:

Summary

XML attributes

android:isDefault Set to true in all of the configurations for which this input method should be considered an option as the default. 
android:settingsActivity Component name of an activity that allows the user to modify the settings for this service. 
android:supportsSwitchingToNextInputMethod Set to true if this input method supports ways to switch to a next input method (e.g. 

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 for test.

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.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

XML attributes

android:isDefault

Set to true in all of the configurations for which this input method should be considered an option as the default.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

This corresponds to the global attribute resource symbol isDefault.

android:settingsActivity

Component name of an activity that allows the user to modify the settings for this service.

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

This corresponds to the global attribute resource symbol settingsActivity.

android:supportsSwitchingToNextInputMethod

Set to true if this input method supports ways to switch to a next input method (e.g. a globe key.). When this is true and InputMethodManager#shouldOfferSwitchingToNextInputMethod() returns true, the IME has to offer ways to invoke InputMethodManager#switchToNextInputMethod() accordingly.

Note that the system determines the most appropriate next input method and subtype in order to provide the consistent user experience in switching between IMEs and subtypes.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

This corresponds to the global attribute resource symbol supportsSwitchingToNextInputMethod.

Fields

CREATOR

Added in API level 3
Creator<InputMethodInfo> CREATOR

Used to make this class parcelable.

Public constructors

InputMethodInfo

Added in API level 3
InputMethodInfo (Context context, 
                ResolveInfo service)

Constructor.

Parameters
context Context: The Context in which we are parsing the input method.
service ResolveInfo: The ResolveInfo returned from the package manager about this input method's component.
Throws
XmlPullParserException
IOException

InputMethodInfo

Added in API level 3
InputMethodInfo (String packageName, 
                String className, 
                CharSequence label, 
                String settingsActivity)

Temporary API for creating a built-in input method for test.

Parameters
packageName String
className String
label CharSequence
settingsActivity String

Public methods

describeContents

Added in API level 3
int describeContents ()

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

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

dump

Added in API level 3
void dump (Printer pw, 
                String prefix)

Parameters
pw Printer
prefix String

equals

Added in API level 3
boolean equals (Object o)

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

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

getComponent

Added in API level 3
ComponentName getComponent ()

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

Returns
ComponentName

getId

Added in API level 3
String getId ()

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

Returns
String

getIsDefaultResourceId

Added in API level 3
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.

Returns
int

getPackageName

Added in API level 3
String getPackageName ()

Return the .apk package that implements this input method.

Returns
String

getServiceInfo

Added in API level 3
ServiceInfo getServiceInfo ()

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

Returns
ServiceInfo

getServiceName

Added in API level 3
String getServiceName ()

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

Returns
String

getSettingsActivity

Added in API level 3
String getSettingsActivity ()

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.

Returns
String

getSubtypeAt

Added in API level 11
InputMethodSubtype getSubtypeAt (int index)

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

Parameters
index int: the index of the subtype to return.
Returns
InputMethodSubtype

getSubtypeCount

Added in API level 11
int getSubtypeCount ()

Return the count of the subtypes of Input Method.

Returns
int

hashCode

Added in API level 3
int hashCode ()

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
int this object's hash code.

loadIcon

Added in API level 3
Drawable loadIcon (PackageManager pm)

Load the user-displayed icon for this input method.

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

loadLabel

Added in API level 3
CharSequence loadLabel (PackageManager pm)

Load the user-displayed label for this input method.

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

toString

Added in API level 3
String toString ()

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
String a printable representation of this object.

writeToParcel

Added in API level 3
void writeToParcel (Parcel dest, 
                int flags)

Used to package this object into a Parcel.

Parameters
dest Parcel: The Parcel to be written.
flags int: The flags used for parceling.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.