How do you set EditText to only accept numeric values in Android?
For example:
<EditText
android:id="@+id/myNumber"
android:digits="0123456789."
android:inputType="numberDecimal"
/>
Add android:inputType="number"
as an XML attribute.
For example:
<EditText
android:id="@+id/myNumber"
android:digits="0123456789."
android:inputType="numberDecimal"
/>
Add android:inputType="number"
as an XML attribute.