My screen freezes after changing the text
<p>I'm trying to use the addChangeTextListener but my screen freezes when I click on a key.
Here is the code:</p>

<pre><code>email = (EditText) findViewById(R.id.email);


    email.addTextChangedListener(new TextWatcher() 
    { 
        @Override
        public void afterTextChanged(Editable s) 
        { 
            if (email.getText().toString().matches("[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+") 
                    &amp;&amp; s.length() &gt; 0)
                error.setText("valid email");
            else
               email.setText("invalid email");              
        }
        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1,int arg2, int arg3) 
        {   
        }
        @Override
        public void onTextChanged(CharSequence arg0, int arg1,int arg2, int arg3) 
        {                   
        } 
    });
</code></pre>
