Just set the IME parameter on your numeric keypad and once press the enter button for the input type programmatically as follows:
EditText editText= (EditText) mView.findViewById(R.id.et_awesome);
editText.setOnEditorActionListener(new EditText.OnEditorActionListener() {
@Override
public boolean onEditorAction(EditText v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO) {
editText.setInputType(InputType.TYPE_CLASS_TEXT);
return true;
}
return false;
}
});
EditText in XML:
<EditText
...
android:imeOptions="actionGo"
android:imeActionLabel="ABC"
android:imeActionId="666"
android:inputType="number"/>
source
share