The following code snippet is used for a text Watcher...it doesnt work...everything works fine,untill the last line of code...
private TextWatcher mobileTextWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
String number = s.toString();
number = AppConstants.convertToOnlyDigits(number);
Editable temp = new SpannableStringBuilder(
AppConstants.formatPhoneNumber(number));
s = temp;
}
};
After that the new doesn't get assigned to s.. Or in otherwords,I cannot see a change in the text in the Edit Text.