I just basically want to switch to the number pad mode as soon a certain EditText has the focus.
I just basically want to switch to the number pad mode as soon a certain EditText has the focus.
Use the below code in java file
editText.setRawInputType(Configuration.KEYBOARD_QWERTY);
Below code will only allow numbers "0123456789”, even if you accidentally type other than "0123456789”, edit text will not accept.
EditText number1 = (EditText) layout.findViewById(R.id.edittext);
number1.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_CLASS_PHONE);
number1.setKeyListener(DigitsKeyListener.getInstance("0123456789”));