keinabel keinabel - 1 month ago 9
Android Question

Can I use numberPassword input type and still see the input?

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.

Answer

This did the job:

uEditText = (EditText) findViewById(R.id.editText);
uEditText.setTransformationMethod(null);