i want to replace typed character with "a" charcter in Android's TextWatcher but save real typed character inside a variable too. to do this, in afterTextChanged i write this code to replace character:
if(s.toString().charAt(s.length()-1) != 'a'){
txtfreak.setText(s.toString().substring(0, s.length()-1) + "a");
txtfreak.setSelection(txtfreak.getText().length());
}
and i want that before replacing, save the real typed character, and to do this, in beforeTextChanged i write this code:
freaktext=s.toString();
but id doesnt work and freaktext contains changes that i made in afterTextChanged!! my question is that beforeTextChanged runs before than afterTextChanged? in my code it seems its not!!