My edit text should only accept a three-digit number, not any other decimal numbers. I used the regex below for this, but it even accepts characters like "." as well as "-". So how to avoid decimal values?
pattern=Pattern.compile("[0-9]{0,2}");
even i set the edit text
android:digits="0123456789"
android:inputType="number"
This does not work. How to solve?
source
share