Soft keyboard - only number

My question is related to this question: Android numeric keypad

BUT, the question above did not answer, so I'm here.

Theres EditText, which when it is touched or has focus, I want the Software Keyboard to display as NUMERIC by default! Of course, you can return to ALPHANUMERIC, but I want to make it appear as NUMERIC.

Thanks guys,

+3
source share
1 answer

Use android:inputTypethe XML attribute with the value number:

<EditText android:id="@+id/edtInput"
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:inputType="number"/>
+6
source

Source: https://habr.com/ru/post/1753980/


All Articles