1Edittext.addtextchangedlistener (NewTextwatcher () {2 3 Public voidaftertextchanged (Editable s) {4 //TODO auto-generated Method Stub5 //s: All characters after the change6Toast.maketext (Getapplicationcontext (), "Change:" +s, Toast.length_short). Show ();7 }8 9 Public voidBeforetextchanged (Charsequence S,intStartintCount,Ten intAfter ) { One //TODO auto-generated Method Stub A //s: all characters before change; start: The position at which the character begins; count: The total number of bytes before the change; After: The number of bytes changed -Toast.maketext (Getapplicationcontext (), "before Change:" +s+ ";" +start+ ";" +count+ ";" +After , Toast.length_short). Show (); - } the - Public voidOnTextChanged (Charsequence S,intStartintbefore, - intcount) { - //TODO auto-generated Method Stub + //S: All characters after the change; start: The position of the beginning of the character; before: The total number of bytes before the change; count: The number of bytes changed -Toast.maketext (Getapplicationcontext (), "After change:" +s+ ";" +start+ ";" +before+ ";" +count, Toast.length_short). Show (); + } A});
Android EditText Input Change Event