0

I have an EditText box and I want the default keyboard that comes up when it is selected to be the numeric keypad. However, I do want to allow users to enter alphabetic characters too. The solutions android:inputType="number" , et.setRawInputType(InputType.TYPE_CLASS_NUMBER)...etc does not work for me because restricts input to numeric digits only. Does someone know some solution??

Paritosh
  • 2,097
  • 3
  • 30
  • 42
IrApp
  • 1,823
  • 5
  • 24
  • 42

1 Answers1

0

Add the following line of code, and it will do the trick :)

editText.setRawInputType(Configuration.KEYBOARD_QWERTY);

This will show the the numeric keypad first, but also allows you to enter free text.

More information tap here

This problem is similar to the this.

Community
  • 1
  • 1
Wasim Reza
  • 136
  • 6
  • For me it is openned the numeric keaypad and I don't have the option to change to the text keypad... :( – IrApp Oct 06 '15 at 13:27