Can I use numberPassword
as input type and still see the input?
My goal is to have a 0-9 keyboard with as few as possible other keys (that's why I prefered numberPassword
over phone
), but the user should still be able to see what he just typed.
This is what I have, but right now the passwords are hidden behind asterisks.
android:digits="1234567890"
android:inputType="numberPassword"
Note: I also tried setInputType(InputType.TYPE_NUMBER_VARIATION_PASSWORD)
, which made the input visible, but changed the keyboard from numbers-only to a regular keyboard. I need they keyboard to display numbers-only though.
This did the job:
uEditText = (EditText) findViewById(R.id.editText);
uEditText.setTransformationMethod(null);
In Java, just do this:
edittext.setTransformationMethod(PasswordTransformationMethod.getInstance());
If you wanted to hide the password later on, you would just do this:
editText.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With