I have a problem with TextWatcher. After i am done editing, i want to append " kg" string. But after i try to edit editView, it loops and my app crashes. Can somebody help me? Thanks
weight = findViewById(R.id.editText);
weight.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
editable.append(" kg");
}
});