Is there a way to only allow numbers x
through y
to be entered in a EditText dynamically?
I.E don't even allow a number below x
or above y
to be entered?
For example x = 1
y = 12
.
Of course i could solve this in Java after the user hit submit with the invalid numbers and prompt them to enter again. It's a time waster though.
Something like android:digits="01234..."
but being able to specify n-th
fields.
e.g
- A range going from 1 to 12
The user should not get confused since they are entering a month number.
I am already using android:maxLength="2"
but i need finer control.