Since: API Level 3
public interface

InputType

android.text.InputType
Known Indirect Subclasses

Class Overview

Bit definitions for an integer defining the basic content type of text held in an Editable object. Supported classes may be combined with variations and flags to indicate desired behaviors.

Examples

A password field with with the password visible to the user:
inputType = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
A multi-line postal address with automatic capitalization:
inputType = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_POSTAL_ADDRESS | TYPE_TEXT_FLAG_MULTI_LINE
A time field:
inputType = TYPE_CLASS_DATETIME | TYPE_DATETIME_VARIATION_TIME

Summary

Constants
intTYPE_CLASS_DATETIMEClass for dates and times.
intTYPE_CLASS_NUMBERClass for numeric text.
intTYPE_CLASS_PHONEClass for a phone number.
intTYPE_CLASS_TEXTClass for normal text.
intTYPE_DATETIME_VARIATION_DATEDefault variation of TYPE_CLASS_DATETIME: allows entering only a date.
intTYPE_DATETIME_VARIATION_NORMALDefault variation of TYPE_CLASS_DATETIME: allows entering both a date and time.
intTYPE_DATETIME_VARIATION_TIMEDefault variation of TYPE_CLASS_DATETIME: allows entering only a time.
intTYPE_MASK_CLASSMask of bits that determine the overall class of text being given.
intTYPE_MASK_FLAGSMask of bits that provide addition bit flags of options.
intTYPE_MASK_VARIATIONMask of bits that determine the variation of the base content class.
intTYPE_NULLSpecial content type for when no explicit type has been specified.
intTYPE_NUMBER_FLAG_DECIMALFlag of TYPE_CLASS_NUMBER: the number is decimal, allowing a decimal point to provide fractional values.
intTYPE_NUMBER_FLAG_SIGNEDFlag of TYPE_CLASS_NUMBER: the number is signed, allowing a positive or negative sign at the start.
intTYPE_TEXT_FLAG_AUTO_COMPLETEFlag for TYPE_CLASS_TEXT: the text editor is performing auto-completion of the text being entered based on its own semantics, which it will present to the user as they type.
intTYPE_TEXT_FLAG_AUTO_CORRECTFlag for TYPE_CLASS_TEXT: the user is entering free-form text that should have auto-correction applied to it.
intTYPE_TEXT_FLAG_CAP_CHARACTERSFlag for TYPE_CLASS_TEXT: capitalize all characters.
intTYPE_TEXT_FLAG_CAP_SENTENCESFlag for TYPE_CLASS_TEXT: capitalize first character of each sentence.
intTYPE_TEXT_FLAG_CAP_WORDSFlag for TYPE_CLASS_TEXT: capitalize first character of all words.
intTYPE_TEXT_FLAG_IME_MULTI_LINEFlag for TYPE_CLASS_TEXT: the regular text view associated with this should not be multi-line, but when a fullscreen input method is providing text it should use multiple lines if it can.
intTYPE_TEXT_FLAG_MULTI_LINEFlag for TYPE_CLASS_TEXT: multiple lines of text can be entered into the field.
intTYPE_TEXT_FLAG_NO_SUGGESTIONSFlag for TYPE_CLASS_TEXT: the input method does not need to display any dictionary-based candidates.
intTYPE_TEXT_VARIATION_EMAIL_ADDRESSVariation of TYPE_CLASS_TEXT: entering an e-mail address.
intTYPE_TEXT_VARIATION_EMAIL_SUBJECTVariation of TYPE_CLASS_TEXT: entering the subject line of an e-mail.
intTYPE_TEXT_VARIATION_FILTERVariation of TYPE_CLASS_TEXT: entering text to filter contents of a list etc.
intTYPE_TEXT_VARIATION_LONG_MESSAGEVariation of TYPE_CLASS_TEXT: entering the content of a long, possibly formal message such as the body of an e-mail.
intTYPE_TEXT_VARIATION_NORMALDefault variation of TYPE_CLASS_TEXT: plain old normal text.
intTYPE_TEXT_VARIATION_PASSWORDVariation of TYPE_CLASS_TEXT: entering a password.
intTYPE_TEXT_VARIATION_PERSON_NAMEVariation of TYPE_CLASS_TEXT: entering the name of a person.
intTYPE_TEXT_VARIATION_PHONETICVariation of TYPE_CLASS_TEXT: entering text for phonetic pronunciation, such as a phonetic name field in contacts.
intTYPE_TEXT_VARIATION_POSTAL_ADDRESSVariation of TYPE_CLASS_TEXT: entering a postal mailing address.
intTYPE_TEXT_VARIATION_SHORT_MESSAGEVariation of TYPE_CLASS_TEXT: entering a short, possibly informal message such as an instant message or a text message.
intTYPE_TEXT_VARIATION_URIVariation of TYPE_CLASS_TEXT: entering a URI.
intTYPE_TEXT_VARIATION_VISIBLE_PASSWORDVariation of TYPE_CLASS_TEXT: entering a password, which should be visible to the user.
intTYPE_TEXT_VARIATION_WEB_EDIT_TEXTVariation of TYPE_CLASS_TEXT: entering text inside of a web form.

Constants

public static final int TYPE_CLASS_DATETIME

Since: API Level 3

Class for dates and times. It supports the following variations: TYPE_DATETIME_VARIATION_NORMAL TYPE_DATETIME_VARIATION_DATE, and TYPE_DATETIME_VARIATION_TIME,.

Constant Value: 4 (0x00000004)

public static final int TYPE_CLASS_NUMBER

Since: API Level 3

Class for numeric text. This class supports the following flag: TYPE_NUMBER_FLAG_SIGNED and TYPE_NUMBER_FLAG_DECIMAL.

Constant Value: 2 (0x00000002)

public static final int TYPE_CLASS_PHONE

Since: API Level 3

Class for a phone number. This class currently supports no variations or flags.

Constant Value: 3 (0x00000003)

public static final int TYPE_CLASS_TEXT

Since: API Level 3

Class for normal text. This class supports the following flags (only one of which should be set): TYPE_TEXT_FLAG_CAP_CHARACTERS, TYPE_TEXT_FLAG_CAP_WORDS, and. TYPE_TEXT_FLAG_CAP_SENTENCES. It also supports the following variations: TYPE_TEXT_VARIATION_NORMAL, and TYPE_TEXT_VARIATION_URI. If you do not recognize the variation, normal should be assumed.

Constant Value: 1 (0x00000001)

public static final int TYPE_DATETIME_VARIATION_DATE

Since: API Level 3

Default variation of TYPE_CLASS_DATETIME: allows entering only a date.

Constant Value: 16 (0x00000010)

public static final int TYPE_DATETIME_VARIATION_NORMAL

Since: API Level 3

Default variation of TYPE_CLASS_DATETIME: allows entering both a date and time.

Constant Value: 0 (0x00000000)

public static final int TYPE_DATETIME_VARIATION_TIME

Since: API Level 3

Default variation of TYPE_CLASS_DATETIME: allows entering only a time.

Constant Value: 32 (0x00000020)

public static final int TYPE_MASK_CLASS

Since: API Level 3

Mask of bits that determine the overall class of text being given. Currently supported classes are: TYPE_CLASS_TEXT, TYPE_CLASS_NUMBER, TYPE_CLASS_PHONE, TYPE_CLASS_DATETIME. If the class is not one you understand, assume TYPE_CLASS_TEXT with NO variation or flags.

Constant Value: 15 (0x0000000f)

public static final int TYPE_MASK_FLAGS

Since: API Level 3

Mask of bits that provide addition bit flags of options.

Constant Value: 16773120 (0x00fff000)

public static final int TYPE_MASK_VARIATION

Since: API Level 3

Mask of bits that determine the variation of the base content class.

Constant Value: 4080 (0x00000ff0)

public static final int TYPE_NULL

Since: API Level 3

Special content type for when no explicit type has been specified. This should be interpreted to mean that the target input connection is not rich, it can not process and show things like candidate text nor retrieve the current text, so the input method will need to run in a limited "generate key events" mode.

Constant Value: 0 (0x00000000)

public static final int TYPE_NUMBER_FLAG_DECIMAL

Since: API Level 3

Flag of TYPE_CLASS_NUMBER: the number is decimal, allowing a decimal point to provide fractional values.

Constant Value: 8192 (0x00002000)

public static final int TYPE_NUMBER_FLAG_SIGNED

Since: API Level 3

Flag of TYPE_CLASS_NUMBER: the number is signed, allowing a positive or negative sign at the start.

Constant Value: 4096 (0x00001000)

public static final int TYPE_TEXT_FLAG_AUTO_COMPLETE

Since: API Level 3

Flag for TYPE_CLASS_TEXT: the text editor is performing auto-completion of the text being entered based on its own semantics, which it will present to the user as they type. This generally means that the input method should not be showing candidates itself, but can expect for the editor to supply its own completions/candidates from InputMethodSession.displayCompletions() as a result of the editor calling InputMethodManager.displayCompletions().

Constant Value: 65536 (0x00010000)

public static final int TYPE_TEXT_FLAG_AUTO_CORRECT

Since: API Level 3

Flag for TYPE_CLASS_TEXT: the user is entering free-form text that should have auto-correction applied to it.

Constant Value: 32768 (0x00008000)

public static final int TYPE_TEXT_FLAG_CAP_CHARACTERS

Since: API Level 3

Flag for TYPE_CLASS_TEXT: capitalize all characters. Overrides TYPE_TEXT_FLAG_CAP_WORDS and TYPE_TEXT_FLAG_CAP_SENTENCES. This value is explicitly defined to be the same as CAP_MODE_CHARACTERS.

Constant Value: 4096 (0x00001000)

public static final int TYPE_TEXT_FLAG_CAP_SENTENCES

Since: API Level 3

Flag for TYPE_CLASS_TEXT: capitalize first character of each sentence. This value is explicitly defined to be the same as CAP_MODE_SENTENCES.

Constant Value: 16384 (0x00004000)

public static final int TYPE_TEXT_FLAG_CAP_WORDS

Since: API Level 3

Flag for TYPE_CLASS_TEXT: capitalize first character of all words. Overrides TYPE_TEXT_FLAG_CAP_SENTENCES. This value is explicitly defined to be the same as CAP_MODE_WORDS.

Constant Value: 8192 (0x00002000)

public static final int TYPE_TEXT_FLAG_IME_MULTI_LINE

Since: API Level 3

Flag for TYPE_CLASS_TEXT: the regular text view associated with this should not be multi-line, but when a fullscreen input method is providing text it should use multiple lines if it can.

Constant Value: 262144 (0x00040000)

public static final int TYPE_TEXT_FLAG_MULTI_LINE

Since: API Level 3

Flag for TYPE_CLASS_TEXT: multiple lines of text can be entered into the field. If this flag is not set, the text field will be constrained to a single line.

Constant Value: 131072 (0x00020000)

public static final int TYPE_TEXT_FLAG_NO_SUGGESTIONS

Since: API Level 5

Flag for TYPE_CLASS_TEXT: the input method does not need to display any dictionary-based candidates. This is useful for text views that do not contain words from the language and do not benefit from any dictionary-based completions or corrections. It overrides the TYPE_TEXT_FLAG_AUTO_CORRECT value when set.

Constant Value: 524288 (0x00080000)

public static final int TYPE_TEXT_VARIATION_EMAIL_ADDRESS

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering an e-mail address.

Constant Value: 32 (0x00000020)

public static final int TYPE_TEXT_VARIATION_EMAIL_SUBJECT

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering the subject line of an e-mail.

Constant Value: 48 (0x00000030)

public static final int TYPE_TEXT_VARIATION_FILTER

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering text to filter contents of a list etc.

Constant Value: 176 (0x000000b0)

public static final int TYPE_TEXT_VARIATION_LONG_MESSAGE

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering the content of a long, possibly formal message such as the body of an e-mail.

Constant Value: 80 (0x00000050)

public static final int TYPE_TEXT_VARIATION_NORMAL

Since: API Level 3

Default variation of TYPE_CLASS_TEXT: plain old normal text.

Constant Value: 0 (0x00000000)

public static final int TYPE_TEXT_VARIATION_PASSWORD

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering a password.

Constant Value: 128 (0x00000080)

public static final int TYPE_TEXT_VARIATION_PERSON_NAME

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering the name of a person.

Constant Value: 96 (0x00000060)

public static final int TYPE_TEXT_VARIATION_PHONETIC

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering text for phonetic pronunciation, such as a phonetic name field in contacts.

Constant Value: 192 (0x000000c0)

public static final int TYPE_TEXT_VARIATION_POSTAL_ADDRESS

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering a postal mailing address.

Constant Value: 112 (0x00000070)

public static final int TYPE_TEXT_VARIATION_SHORT_MESSAGE

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering a short, possibly informal message such as an instant message or a text message.

Constant Value: 64 (0x00000040)

public static final int TYPE_TEXT_VARIATION_URI

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering a URI.

Constant Value: 16 (0x00000010)

public static final int TYPE_TEXT_VARIATION_VISIBLE_PASSWORD

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering a password, which should be visible to the user.

Constant Value: 144 (0x00000090)

public static final int TYPE_TEXT_VARIATION_WEB_EDIT_TEXT

Since: API Level 3

Variation of TYPE_CLASS_TEXT: entering text inside of a web form.

Constant Value: 160 (0x000000a0)