PhoneNumberManager
public
class
PhoneNumberManager
extends Object
java.lang.Object | |
↳ | android.telephony.PhoneNumberManager |
PhoneNumberManager provides APIs for parsing phone numbers from various sources, such as URIs.
Summary
Public methods | |
---|---|
ParsedPhoneNumber
|
parsePhoneNumber(List<Uri> associatedUris, String countryIso)
Parses the associated URIs into a |
Inherited methods | |
---|---|
Public methods
parsePhoneNumber
public ParsedPhoneNumber parsePhoneNumber (List<Uri> associatedUris, String countryIso)
Parses the associated URIs into a ParsedPhoneNumber
object.
This method attempts to parse the provided list of URIs into a valid phone number. The order of the URIs in the list is significant; it is recommended to prioritize URIs that are more likely to contain a valid phone number by placing them at the beginning of the list. The method will iterate through the list and return the first URI that can be successfully parsed into a valid phone number.
Parameters | |
---|---|
associatedUris |
List : The list of URIs to be parsed. The order of the URIs in the list
matters. The method iterates through the list and stops at the first
URI that can be parsed into a valid phone number. It is recommended to
place the URIs that are most likely to contain a valid phone number at
the beginning of the list.
This value may be null . |
countryIso |
String : The country ISO code to be used for parsing.
This value cannot be null . |
Returns | |
---|---|
ParsedPhoneNumber |
A ParsedPhoneNumber object representing the first successfully parsed
phone number from the provided list or an error if no numbers could be parsed.
This value cannot be null . |