I tried the following code to format phone number in android:-
public static String formatPhoneNumber(String number){
return PhoneNumberUtils.formatNumber(number);
}
I am passing “19253951646” to the function..
It returns the text in the format 1-925-395-1646.
I want the result in the format 1(925)395-1646.
Any help would be highly apprciated.
Wrote my own function to format the number.