title: Validate an email inside an EditText
body: <p>I want to validate an email introduced inside an EditText and this the code that I already have:</p>
  <blockquote>
  <p>final EditText textMessage = (EditText)findViewById(R.id.textMessage);</p>
  <p>final TextView text = (TextView)findViewById(R.id.text);</p>
  </blockquote>
  <pre><code>    textMessage.addTextChangedListener(new TextWatcher() { 
          public void afterTextChanged(Editable s) { 
              if (textMessage.getText().toString().matches(&quot;[a-zA-Z0-9._-]+@[a-z]+.[a-z]+&quot;) &amp;&amp; s.length() &gt; 0)
              {
                  text.setText(&quot;valid email&quot;);
              }
              else
              {
                  text.setText(&quot;invalid email&quot;);
              }
          } 
          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 problem is that when I introduce 3 characters after the &quot;@&quot;, it appears the message &quot;valid email&quot;, when it must appear when I introduce the complete email.</p>
  <p>Any suggerence?</p>
  <p>Thank you all!</p>