Android Edittext Inputtype Tutorial : Getting started with Android
Edittext inputtype is used to set your input type for edittext.
Ex:- You can set your edittext inputtype as ‘Phone’. So that user can able to type only numbers. If it is ‘Time’ it will allow only time related characters to be entered.
Edittext Inputtypes are:-
- text
- textCapCharacters
- textCapWords
- textCapSentences
- textAutoCorrect
- textAutoComplete
- textMultiLine
- textImeMultiLine
- textNoSuggestions
- textUri
- textEmailAddress
- textEmailSubject
- textShortMessage
- textLongMessage
- textPersonName
- textPostalAddress
- textPassword
- textVisiblePassword
- textWebEditText
- textFilter
- textPhonetic
- number
- numberSigned
- numberDecimal
- phone
- datetime
- date
- time
1
|
EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="wrap_content" android:inputType="number" android:text="9944456789"/>
|
Here the inputType is ‘Number’. You can set one or more inputType to a edittext at a time.
The Output will look like
0
0