I have an EditText with inputMode = text. By default software keyboard is shown as alphabetical and user have to switch it to numeric by pressing specific key (
Just set it with the normal setter:
EditText editText = (EditText) findViewById(R.id.edittext); editText.setInputType(InputType.TYPE_CLASS_NUMBER); // or editText.setInputType(InputType.TYPE_CLASS_TEXT);