I want a keyboard with ONLY visible numbers to an EditText view. Without any other character.
I have tested with all available inputs and don't work. I have searched a way to get a keyboard only with numbers but I have only seen references to:
android: inputType = "numberPassword"
But I want visible numbers in EditText. Someone can help me?
I want a keyboard like that: (numberPassword)
I have tried with:
android:digits="0123456789"
android:inputType="phone"
and
android:inputType="number"
and appears like that:
android:inputType="number"
orandroid:inputType="phone"
. You can keep this. You will get the keyboard containing numbers. For further details on different types of keyboard, check this link.I think it is possible only if you create your own soft keyboard. Or try this
android:inputType="number|textVisiblePassword
. But it still shows other characters. Besides you can keepandroid:digits="0123456789"
to allow only numbers in youredittext
. Or if you still want the same as in image, try combining two or more features with | separator and check your luck, but as per my knowledge you have to create your own keypad to get exactly like that..If you want to show just numbers without characters, put this line of code inside your xml file
android:inputType="number"
. Below image shows the exact outputenter image description here
If you want to show a number keyboard which also shows characters, put
android:inputType="phone"
on your xml. Below shows the exact output.with characters
And if you want to show a number keyboard that masks your input just like a password, put
android:inputType="numberpassword"
. Below is the output.enter image description here
I'm really sorry if I only post the links of the screenshot, I want to do a research on how to do really post images here but it might consume my time so here it is. I hope my post can help other people. Yes my answer is duplicate with other answers posted here but to save other people's time that they might need to run their code before seeing the output, my post might save you some time. Have a nice day everyone!