myEditText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD);
private class NumericKeyBoardTransformationMethod extends PasswordTransformationMethod {@Override
public CharSequence getTransformation(CharSequence source, View view) {
return source;
}
}
myEditText.setTransformationMethod(new NumericKeyBoardTransformationMethod());
//or
edit.setRawInputType(Configuration.KEYBOARD_12KEY);