I have been trying to have my editText accept phone values only as well as extensions. I managed to do this in its xml phone using.
android:inputType="phone"
android:digits="0123456789()- x"
Now the other problem I have been attempting to figure out is how to have editText display ( ) - at all times and when more numbers pressed (ooo) ooo-oooo xoooo. Currently I have editText
editTextpponentTeamContactPhone.addTextChangedListener(new PhoneNumberFormattingTextWatcher() {
PhoneNumberUtils phoneNumberUtils;
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
phoneNumberUtils.formatNumber(editTextpponentTeamContactPhone.getText().toString());
super.onTextChanged(s, start, before, count);
}
});
This is close to what I want. It becomes (xxx) xxx-xxxx but not extensions so was wondering if anyone had come through something similar I am looking but not getting much luck.