I can get the old value. But I do not have a solution to get a new entered value.
In fact, I want to separate the old value from the new value.
For example: If oldText=hello
and new entered EditText value equal to (hello w
or w hello
), I want newText=w
.
public class MyTextWatcher implements TextWatcher {
private String oldText = "";
private String newText = "";
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
this.oldText = s.toString();
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
}
}
Thanks for help.