I have an EditText view and I want it to format the user\'s input into the phone number format. For example, when the user types in 1234567890, the EditText view should dyna
I did a combination of things, i modified my input type to phone, then I used regex to remove all non numeric characters: phonenumber = phonenumber.replaceAll("\D", "");
In your Java code you can use
yourEditText.setInputType(InputTytpe.TYPE_CLASS_PHONE)
or in your xml
android:inputType="phone"
Java
XML