Alex Rivera | Logout

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

Asked 2011-01-10T09:06:11.743
226

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

Edit
Report

1 Answer

425

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

answered 2011-01-10T09:28:01.330

Your Answer