Othman Shawgan
Othman Shawgan

Reputation: 122

Using numeric keyboard on EditText in android studio

I'm using an EditText in my android app, and I want a numeric keyboard to show when I tap and try to edit it.

Upvotes: 1

Views: 286

Answers (1)

Othman Shawgan
Othman Shawgan

Reputation: 122

There are two easy ways to do it, add one of the following to EditText block in XML file:

  1. To get a Numeric dial keyboard pad
        android:inputType="phone"
        android:digits="1234567890"
  1. To get the Numeric section of keyboard
        android:inputType="number"

Upvotes: 3

Related Questions