Default numeric keypad

Possible duplicate:
EditText with default numeric keypad but with alphabetic characters

I have an EditText where the user can enter both numbers (0 - 9) and characters (a -z, what ever). But I would like to set the default numeric keypad. I want the numeric keypad to appear first, but the user can press the [ABC] button and enter any character he wants.

Is it possible?

+2
source share
2 answers

As far as I know, if you use inputType="phone" / inputType="number" , you cannot switch to a text keyboard. This does not apply to tablets or any specific version of the Android OS.

A workaround would be to change it programmatically using setInputType . You must implement it in the way that best suits your application.

+2
source

You can modify EditText to include:

 android:inputType="phone" 

It's only numpad

or

 android:inputType="number" 

Which also allows you to enter characters, but starts with a numeric keypad.

0
source

All Articles