Search code examples
androidandroid-edittext

How do you set EditText to only accept numeric values in Android?


I have an EditText in which I want only integer values to be inserted. Can somebody tell me which property I have to use?


Solution

  • Add android:inputType="number" as an XML attribute.