EditText, inputType values (XML)

AndroidLayoutAndroid EdittextAndroid Inputtype

Android Problem Overview


Where can I find the values that InputType can has?

I'm aware of http://developer.android.com/reference/android/text/InputType.html, but how should the values look like in layout XML files?

Android Solutions


Solution 1 - Android

You can use the properties tab in eclipse to set various values.

here are all the possible values

  • none
  • text
  • textCapCharacters
  • textCapWords
  • textCapSentences
  • textAutoCorrect
  • textAutoComplete
  • textMultiLine
  • textImeMultiLine
  • textNoSuggestions
  • textUri
  • textEmailAddress
  • textEmailSubject
  • textShortMessage
  • textLongMessage
  • textPersonName
  • textPostalAddress
  • textPassword
  • textVisiblePassword
  • textWebEditText
  • textFilter
  • textPhonetic
  • textWebEmailAddress
  • textWebPassword
  • number
  • numberSigned
  • numberDecimal
  • numberPassword
  • phone
  • datetime
  • date
  • time

Check here for explanations: http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType

Solution 2 - Android

Supplemental answer

Here is how the standard keyboard behaves for each of these input types.

enter image description here

See this answer for more details.

Solution 3 - Android

android:inputMethod

is deprecated, instead use inputType :

 android:inputType="numberPassword"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjgauffinView Question on Stackoverflow
Solution 1 - AndroidRavi VyasView Answer on Stackoverflow
Solution 2 - AndroidSuragchView Answer on Stackoverflow
Solution 3 - AndroidHamed JalilianiView Answer on Stackoverflow