Search code examples
androidkeyboardshownumerical

Show numerical keyboard_android


I want to show numerical keyboard when edittext is focused. I tried

myEditText.setInputType(InputType.TYPE_CLASS_NUMBER)

but then it only accepts number as an input and ignores backspace etc.

I just want that numerical keyboard is showed rather than letters


Solution

  • You may use TYPE_CLASS_PHONE, it adds some symbols (#+.), spaces and backspaces.

    More infos here: http://developer.android.com/reference/android/text/InputType.html#TYPE_CLASS_PHONE