title: Permit only 1 character in EditText and always overwrite when user input it
body: <p>I need to make an <code>EditText</code> which would accept only one character and only character (letter/alpha). And if user enters other char, it should replace existing one (like overwrite method of text input with 1 allowed symbol).</p>
  
  <ol>
  <li><p>I know how to set the max length of text in properties. But if I set it
  to 1, then no other char could be inserted before user deletes an
  existing one. But I want to replace existing char with that new entered
  one automatically without manual deleting. How to do that?</p></li>
  <li><p>I know how to set property to allow only digits in an <code>EditText</code>, but I
  can't figure out how to allow only chars. So the second question is how to allow only characters in <code>EditText</code>?</p></li>
  </ol>
  
  <p>Currently I'm using an <code>EditText</code> with max text size=2 with the following code:</p>
  
  <pre><code>final EditText editLetter = (EditText)findViewById(R.id.editHouseLetter); 
  editLetter.addTextChangedListener(new TextWatcher() {
  
      public void afterTextChanged(Editable s) {
          if (s!=null &amp;&amp; s.length()&gt;1){
              editLetter.setText(s.subSequence(1, s.length()));
              editLetter.setSelection(1);
          }
      }
  
      public void beforeTextChanged(CharSequence s, int start, int count,
          int after) {
  
      }
  
      public void onTextChanged(CharSequence s, int start, int before,
          int count) {
  
      }
  });
  </code></pre>
  
  <p>The point is, when a user enters a second char, the first one should be deleted. Making text size to 2 allows user to enter another char after one has been already entered.</p>
  
  <p>I don't really understand how it works but it does :). And additionally I had to point cursor in <code>EditText</code> to the last position because it always goes to beginning which makes unable to enter anything at all. Didn't get why is that either.</p>
  
  <p>Main point of this solution is that it has a 2-chars sized <code>EditText</code>, but I want it 1-char sized. And it allows to enter anything besides the letters(chars/alpha) and I want nothing but chars.</p>
  
  <p>Using the advice provided by <strong>sgarman</strong> and <code>Character.isLetter()</code> function, <code>afterTextChanged</code> method looks this way now:</p>
  
  <pre><code>public void afterTextChanged(Editable s) {
      int iLen=s.length();
      if (iLen&gt;0 &amp;&amp; !Character.isLetter((s.charAt(iLen-1)))){
          s.delete(iLen-1, iLen);
          return;
      } 
      if (iLen&gt;1){
          s.delete(0, 1);
      } 
  }
  </code></pre>
  
  <p>I've discovered that using <code>Selection.setSelection</code> is not required in this case. Now it has a filter allowing input of letters only. It's almost the answer that I want. The only one thing left is how to do the same with 1-symbol sized <code>EditText</code>?</p>