How can we use android:inputType in EditTextPreference?

The docs don't list the attributes for that class, but the InputType attribute (and other EditText and TextView attributes) still work. It's only stated in the text. Also see this related question.

The EditTextPreference documentation doesn't explicitly list all the attributes it supports, but the text states:

See EditText Attributes.

The link there isn't very useful (they probably reorganised some of the attributes but never updated some links to it), but here's a direct link to inputType values. As a quick summary those values are (as of the time of posting):

  • 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

You can apparently use one or more of these, separated by a | (I've never done this though).