title: EditText validation whith use of setError, disappearing popup and icon. (Android)
body: <p>I have an EditText watched by TextWatcher, which is validated with Pattern, Matcher and a regexp. It works almost OK. When user enters char into EditText, TextWatcher lunches onTextChanged method and validate entered char. Every thing works fine there is an error icon on right side of EditText and a popup thats says "error". OK. Now when user enter second char, popup and error icon disappears. Third char, it again appears. Forth it disappears and so on and so on.... Why? How to make icon and popup to be always visible when there is an error? Code:</p>
  
  <pre><code>public EditTextValidator(EditText editText, String patternString, String errorString)
  {
      this.editText = editText;
      this.errorString = errorString;
      this.patternString = patternString;
  
  }
  
  @Override
  public void afterTextChanged(Editable s)
  {
  
  }
  
  @Override
  public void beforeTextChanged(CharSequence s, int start, int count, int after)
  {
  
  }
  
  @Override
  public void onTextChanged(CharSequence s, int start, int before, int count)
  {
      Pattern pattern = Pattern.compile(patternString);
      Matcher matcher = pattern.matcher(s);
  
      if (!matcher.matches())
      {
          editText.setError(errorString);
  
      } else
      {
          editText.setError(null);
  
      }
  }
  
  private EditText editText;
  private String errorString;
  private String patternString;
  
  }
  </code></pre>
  
  <p>I use Android 2.1 Sdk  (Api 7)</p>