PhoneNumberManager.ParsePhoneNumber(IList<Uri>, String) Method

Definition

Parses the associated URIs into a ParsedPhoneNumber object.

[Android.Runtime.Register("parsePhoneNumber", "(Ljava/util/List;Ljava/lang/String;)Landroid/telephony/ParsedPhoneNumber;", "GetParsePhoneNumber_Ljava_util_List_Ljava_lang_String_Handler", ApiSince=36)]
public virtual Android.Telephony.ParsedPhoneNumber ParsePhoneNumber(System.Collections.Generic.IList<Android.Net.Uri>? associatedUris, string countryIso);
[<Android.Runtime.Register("parsePhoneNumber", "(Ljava/util/List;Ljava/lang/String;)Landroid/telephony/ParsedPhoneNumber;", "GetParsePhoneNumber_Ljava_util_List_Ljava_lang_String_Handler", ApiSince=36)>]
abstract member ParsePhoneNumber : System.Collections.Generic.IList<Android.Net.Uri> * string -> Android.Telephony.ParsedPhoneNumber
override this.ParsePhoneNumber : System.Collections.Generic.IList<Android.Net.Uri> * string -> Android.Telephony.ParsedPhoneNumber

Parameters

associatedUris
IList<Uri>

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.

countryIso
String

The country ISO code to be used for parsing.

Returns

A ParsedPhoneNumber object representing the first successfully parsed phone number from the provided list or an error if no numbers could be parsed.

Attributes

Remarks

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.

Java documentation for android.telephony.PhoneNumberManager.parsePhoneNumber(java.util.List<android.net.Uri>, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to