I have been trying to find simple solution to format the phone number as user types .
I do not want to use any library for formatting . Any ideas on how to do it ?
I have been trying to find simple solution to format the phone number as
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Seems you need to add TextChangedListener to your edit and prepare processing in there.
Here’s small example of inserting +7 in the beginning (actually, for – in the middle the logic stays the same, only another string operations needed):
It’s not much code and logic, so seems no third party libraries are needed for this type of EditText handling.