I have an edit-text changed listener that adds a certain text when the user removes its contents like so :-
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
String e = s.toString();
if(e.isEmpty()){
edittext.settext(k);
}
the text is first highlighted when user clicks on it then user can choose to make it empty using backspace or just write a new text clearing out the previous one .It works perfectly in Nexus API 25 emulator but in my Alcatel one touch pop API 22 when the user is just writing text after the highlight it sets the text to k(considers the edit-text empty) just any suggestions would be helpful.
I tried cleaning the code but nothing worked I don't know how I could adapt the settings for different API's