Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText, inputType values (XML)

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?

like image 640
jgauffin Avatar asked Oct 15 '22 12:10

jgauffin


People also ask

What is the EditText attribute Android InputType used for?

The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.

How do you get the value from edit text?

getText(); demo. setText(); In below code, we took four EditText name, lastname, mobile and address and then use findviewbyid to looks through XML layout and returns reference to a view (In this case this is an EditText) and after that get text from all these EditText and set them in a TextView in a form of string.

What is an InputType?

android.text.InputType. Known indirect subclasses. EditorInfo. EditorInfo. An EditorInfo describes several attributes of a text editing object that an input method is communicating with (typically an EditText), most importantly the type of text content it contains and the current cursor position.


1 Answers

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

like image 97
Ravi Vyas Avatar answered Oct 26 '22 23:10

Ravi Vyas