0

I have an EditText field that will primarily have numbers inputted. Thus, in most cases, a number keyboard would be most appropriate. I set android:inputType="number" in xml, but now I only have number keyboards and no way to input letters. Is there a way to primarily call for number keyboards and yet enable switching to a letter keyboard?

Nathaniel Ford
  • 18,661
  • 20
  • 81
  • 93
Victoria
  • 198
  • 1
  • 12
  • there are solutions: http://stackoverflow.com/questions/3544214/edittext-with-number-keypad-by-default-but-allowing-alphabetic-characters – Android Android Apr 27 '15 at 10:23

1 Answers1

1

you could do it like this :

yourEditText.setRawInputType(Configuration.KEYBOARD_QWERTY);

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

Farouk Touzi
  • 3,479
  • 2
  • 17
  • 24