Input keyboard type on Android
Setting the keyboard type for input fields helps user entering data. For example, if users need to enter a number, it helps to show a numeric keyboard. If users need to enter an e-mail address, it helps if the at-key (@
) is shown. You should always set an appropriate keyboard type.
On Android, you can set a keyboard type by using the android:inputType
property. You can combine values with each other.
The following constants are defined:
date
: for entering a datedatetime
: for entering a date and timenone
: to disable inputnumber
: for entering a numbernumberDecimal
: for entering decimal numbersnumberPassword
: for entering a numeric passwordnumberSigned
: for entering a positive or negative numberphone
: for entering a telephone numbertext
: for entering normal texttextAutoComplete
: to enable automatic completiontextAutoCorrect
: to enable automatic correctiontextCapCharacters
: to automatically convert characters to uppercasetextCapSentences
: to automatically capitalize sentencestextCapWords
: to automatically capitalize wordstextEmailAddress
: for entering an email addresstextEmailSubject
: for entering the subject of an emailtextFilter
: for entering text to filter withtextImeMultiLine
: to force entering multiple lines of texttextLongMessage
: for entering a long messagetextMultiLine
: for entering multiple lines of texttextNoSuggestions
: to disable suggestionstextPassword
: for entering a passwordtextPersonName
: for entering a nametextPhonetic
: for entering phonetic texttextPostalAddress
: for entering a postal addresstextShortMessage
: for entering a short messagetextUri
: for entering a URLtextVisiblePassword
: for entering a visible passwordtextWebEditText
: for entering text in a web formtextWebEmailAddress
: for entering an email address in a web formtextWebPassword
: for entering a password in a web formtime
: for entering a time
Example of using inputType
: