Darshan Gowda
Darshan Gowda

Reputation: 5216

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?

Upvotes: 7

Views: 9201

Answers (1)

Ewoks
Ewoks

Reputation: 12435

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

Upvotes: 6

Related Questions