Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make custom Text Input type Android

I need the user to enter text in a Edit Text with custom keyboard options. That is, I need the keypad to show only "S","A","B","C","D","E" and "F" characters. Is it possible to implement this?

like image 284
Darshan Gowda Avatar asked Jan 18 '14 06:01

Darshan Gowda


1 Answers

Much easier solution is to add digit parameter in xml definition of EditText like following:

android:digits="SABCDEF"
android:inputType="textNoSuggestions"

Shown keyboard will have all characters but when user try to enter any of not allowed that will be ignored.

Hope this helps

Edit: textNosuggestions to textNoSuggestions

like image 54
Ewoks Avatar answered Sep 20 '22 12:09

Ewoks