EditText - change text while typing
<p>I need to replace the text inside the EditText while typing :
Example : if the user pressed "A" it would be stored into a buffer and on the EditText "D" is displayed instead (looks like he pressed "D").
Now I can read the pressed character but I can't display any character in the et to avoid stackoverflow :</p>

<pre><code>final EditText et = (EditText) findViewById(R.id.editTexts);
    final TextView tv = (TextView) findViewById(R.id.textView2);

    et.addTextChangedListener(new TextWatcher()
    {
            public void afterTextChanged(Editable s){}
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            } 
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                if(s.length() &gt; 0) {
                    tv.setText(s.toString().substring(s.length()-1));
                    et.setText("");
                }
            }
    });
</code></pre>
