On the soft keyboard in Android you can set the soft keyboard to show the numbers instead of a-z keyboard using android:inputType="numberDecimal"
. However, what do I do if I only want to show the top number row 1 2 3 4 5 6 7 8 9 0
and not the following rows starting with @ # $ % ...
?
Thanx for listening!
The keyboard actually has a full number pad layout too; unlike some keyboards, it's available in any app. To get the number pad, and tap the special character key in the lower left corner of the keyboard.
What to Know. Go to Settings > System > Languages & input. Tap Virtual keyboard and choose your keyboard. You can switch between keyboards by selecting the keyboard icon at the bottom of most keyboard apps.
First, tap the symbols button in the bottom-left corner of the Gboard keypad. Then, just to the left of the space bar, you'll see a 1 2 3 4 button, with the four numbers arranged two on top of the other. Tap it, and voilà—there's your numeric keypad.
android:inputType="phone" android:digits="1234567890"
is an option
You must only add this line on your code:
input.setRawInputType(Configuration.KEYBOARD_12KEY);
this will show only the numeric keyboard.
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