title: How to limit EditTextPreference to a range 1024:65535
body: <p>I have a EditTextPreference defined as:</p>
  
  <pre><code>&lt;EditTextPreference 
  android:defaultValue="8888" 
  android:key="someKey" 
  android:title="SomeString"
  android:inputType="number"    
  &gt;
  </code></pre>
  
  <p>EditTextPreference uses an EditText internally which can be obtained with <code>EditTextPreference.getEditText()</code>.</p>
  
  <p>I would like to limit the number the user can input to a range of integers between 1024 and 65535. How can I do that?</p>
  
  <p>I tried to use both an InputFilter and a TextWatcher without success.</p>
  
  <p>Any ideas?</p>
  
  <p>As you might have guessed I am trying to validate inputting a network port. Maybe I should use some other kind of input for this?</p>