5

I've tried every variation I can think of for input type and raw input type, but I can't get it so that the number keyboard shows first, but then allows you to toggle back to the text keyboard. Right now if you specify text|number, or number|text, the letters always show first, and then you have to toggle to the number keyboard. Is it possible to do the opposite?

  • Do you need just numbers or do you need the special characters as well? – Otra Aug 18 '11 at 19:43
  • 1
    possible duplicate of [How do I show the number keyboard on an EditText in android](http://stackoverflow.com/questions/1119583/how-do-i-show-the-number-keyboard-on-an-edittext-in-android) – George Cummins Aug 18 '11 at 19:44
  • @George Cummins That does not appear to work in all devices. –  Aug 18 '11 at 19:53

2 Answers2

2

Per my research and Bert B.'s comment, there is no way to do this cross-device compatible.

  • Dissapointing answer. It looks like it should be so easy. I have tried programatically clicking the keyboard, Dispatching keyevents tot no avail. It really seems impossible – Entreco Aug 03 '14 at 07:47
0

Just add

android:inputType="number"

into your EditText field. This should automatically trigger the keyboard to show the number pad first.

Bert B.
  • 579
  • 2
  • 12
  • 26
  • I'm testing on the Galaxy Tab, and this does not work. The "ABC" in the bottom does not work. It won't toggle back. –  Aug 18 '11 at 19:52
  • Oh right, that would make that numbers only. Try this suggestion: http://stackoverflow.com/questions/3034287/how-can-i-default-to-the-numeric-keypad-on-focus-of-an-edittext-view – Bert B. Aug 18 '11 at 20:00
  • All that does is programmatically change the keyboard. You still can't switch back to the other one. –  Aug 18 '11 at 20:17
  • You know, I don't think it's possible. Even this guy asked ~2 years ago and didn't see an answer http://groups.google.com/group/android-developers/browse_thread/thread/23ca35f83e1ca4b6?pli=1 – Bert B. Aug 18 '11 at 20:22
  • I think you are correct because I came across that same message board and one other one, and nobody seems to have an answer. It appears if you specify that text and number are allowed, the text keyboard will always show first. –  Aug 18 '11 at 20:37
  • 4
    I believe that you are right in that conclusion. I find it weird that it's not possible to default to a numeric keyboard with the option of switching back. I guess it's time to file it as a bug! http://source.android.com/source/report-bugs.html – Bert B. Aug 18 '11 at 20:43