i have a program where i have multiple editText and one final editText…. I want to implement TextWatcher to reflect the changes in the total edittext.. But I don’t know how to implement all this for changes in multiple editTexts.
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
total+=new Integer(s.toString());
_EDTotal.setText(""+total);
}
in the above example I will face a problem… When i enter the value at the first I will setText the correct value in the _EDTotal, but if i delete (use backSpace) in the editText using the listener I will not be able to replace it with new prob.
try like this: