Forcing an EditText to accept a number value from a certain range entails the use of filters using the InputFilter class. I created a custom made class that lets you set an EditText to accept only values between a minimum and maximum value.

Here is the class.

To use the class, do it like this which sets an EditText to accept any number between 1 and 100.

There! Now you should be able to have your EditText accept only your desired values. Just be sure you set your EditText widget to accept only numbers.

Related Posts Plugin for WordPress, Blogger...