I am using onTextChanged(charSequence s, int start, int before, int count) and would like to get the deleted text of an Edittext. I believe you can get it through the parameter s but how would I know that the text has been deleted not added? (E.g. if s.equals("Example") how do I know that “Example” was deleted from, not added to, the Edittext?)
I am using onTextChanged(charSequence s, int start, int before, int count) and would like
Share
If you’re deleting text from an EditText, the final parameter for
onTextChanged,int lengthAftershould be equal to zero (you have this parameter labeled ‘count’).onTextChanged (CharSequence text, int start, int lengthBefore, int lengthAfter)You could also consider using a
TextWatcherfor finer control.