EditText input character change event
EditText. addTextChangedListener (new TextWatcher () {public void afterTextChanged (Editable s) {// TODO Auto-generated method stub // s: All characters after the change Toast. makeText (getApplicationContext (), "Change:" + s, Toast. LENGTH_SHORT ). show ();} public void beforeTextChanged (CharSequence s, int start, int count, int after) {// TODO Auto-generated method stub // s: All characters before the change; start: the starting position of the character; count: the total number of bytes before the change; after: the number of bytes after the change Toast. makeText (getApplicationContext (), "Before change:" + s + ";" + start + ";" + count + ";" + after, Toast. LENGTH_SHORT ). show ();} public void onTextChanged (CharSequence s, int start, int before, int count) {// TODO Auto-generated method stub // S: All characters after the change; start: the starting position of the character; before: the total number of bytes before the change; count: the number of bytes after the change Toast. makeText (getApplicationContext (), "changed:" + s + ";" + start + ";" + before + ";" + count, Toast. LENGTH_SHORT ). show ();}});