title: Set EditText filter to numbers within a custom range
body: <p>I am looking for a way to limit the numbers I enter into the EditText field, but I am encountering some obstacles.</p>
  
  <p>I have already thoroughly researched for a solution to my problem, which I will define specifically below.</p>
  
  <p>I want to create 4 different EditText fields in which each accepts the following ranges: (1, 24); (80, 200); (1, 999); (40, 70).</p>
  
  <p>These, for simplicity, will not be decimals (or doubles/floats/longs) but only integers.</p>
  
  <p>I have looked into the solutions provided by the following links, and have provided their shortcomings.</p>
  
  <p><a href="https://stackoverflow.com/questions/5200689/android-limiting-edittext-to-numbers">Android: Limiting EditText to numbers</a>
  This solution only tells me how to limit the entered text to numerical data only. It does not provide ranges.</p>
  
  <p><a href="https://stackoverflow.com/questions/14212518/is-there-any-way-to-define-a-min-and-max-value-for-edittext-in-android">Is there a way to define a min and max value for EditText in Android?</a>
  The accepted solution does accomplish the goal of setting the range, but the problem is that it only works for the ranges (1, 24) and (1, 999) due to its implementation. The problem is that if I look for values in the intervals (40, 70) or (80, 200), I will start by entering one digit at a time, so this does not work. It will deny the single digit input, which makes it non-user friendly.</p>
  
  <p><a href="https://stackoverflow.com/questions/14036674/how-to-limit-the-text-in-numbers-only-from-0-59-in-edit-text-in-android">How to limit the text in numbers only from 0-59 in Edit Text in Android?</a>
  I believe the accepted solution here has the same problem as the one above, since it takes one digit at a time. I considered using the same method under afterTextChanged instead on onTextChanged, but to no avail.</p>
  
  <p><a href="https://stackoverflow.com/questions/28817355/number-range-on-an-edittext-only-want-numbers-between-1-and-10">Number range on an edittext - only want numbers between 1 and 10</a>
  This solution involves a button click to evaluate whether the number falls in the given range, so this would be considered an "after-the-fact" solution.  I need an EditText that rejects the user's input in real time.</p>
  
  <p>Your assistance is greatly appreciated and will probably help resolve the problems that many others have apparently had (reading the comments, others seem to want ranges that don't start/end in single-digit numbers).</p>