3

my question is kinda related to this question: Numeric Soft Keyboard on Android

BUT, the question above isnt answered, so here i am.

Theres a EditText that when it gets touched or has focus, i want the Software Keyboard to show up by default as NUMERIC! Of course, you can switch back to ALPHANUMERIC, but i want to force it to show up as NUMERIC.

Thanks guys

Community
  • 1
  • 1

1 Answers1

5

Use the android:inputType XML attribute with the number value:

<EditText android:id="@+id/edtInput"
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:inputType="number"/>
Cristian
  • 198,401
  • 62
  • 356
  • 264