title: Textwatcher android
body: <p>I have a <code>TextWatcher</code> on my android app.
  Problem is I want it to listen on every text change, and append a string of the same <code>TextView</code>.</p>
  
  <p>For example, a user inputs <code>A1A2A3A4A5A6A7A8A9</code> on the <code>EditText</code> field, then I want a textview right on top to hyphenate after 6 characters. so the text view dispalys
  <code>A1A2A3-A4A5A6-A7A8A9</code>, while the edit text still diplays <code>A1A2A3A4A5A6A7A8A9</code></p>
  
  <p>I tried this on aftertextchanged, and it did not work:</p>
  
  <pre><code>    @Override
  public void afterTextChanged(Editable s) {
  
      String hyphenated = "";
  
  
      if (s.length() == 6)
      {
          hyphenated = s.toString()+"-";
          mCounter.setText(hyphenated);
      }
  
      if (s.length() == 12)
      {
          hyphenated = s.toString()+"-";
          mCounter.setText(hyphenated);
      }
  
  }
  </code></pre>