Stay organized with collections
Save and categorize content based on your preferences.
PhoneNumberManager
open class PhoneNumberManager
PhoneNumberManager provides APIs for parsing phone numbers from various sources, such as URIs.
Summary
Public methods
parsePhoneNumber
open fun parsePhoneNumber(
associatedUris: MutableList<Uri!>?,
countryIso: String
): ParsedPhoneNumber
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 |
MutableList<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. This value may be null . |
countryIso |
String: The country ISO code to be used for parsing. This value cannot be null . |
Return |
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 . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# PhoneNumberManager\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPhoneNumberManager\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/telephony/PhoneNumberManager \"View this page in Java\") \n\n```\nopen class PhoneNumberManager\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.telephony.PhoneNumberManager](#) |\n\nPhoneNumberManager provides APIs for parsing phone numbers from various sources, such as URIs.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [ParsedPhoneNumber](/reference/kotlin/android/telephony/ParsedPhoneNumber) | [parsePhoneNumber](#parsePhoneNumber(kotlin.collections.MutableList,%20kotlin.String))`(`associatedUris:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Uri](../net/Uri.html#)!\u003e?`, `countryIso:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Parses the associated URIs into a [ParsedPhoneNumber](/reference/kotlin/android/telephony/ParsedPhoneNumber) object. |\n\nPublic methods\n--------------\n\n### parsePhoneNumber\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun parsePhoneNumber(\n associatedUris: MutableList\u003cUri!\u003e?, \n countryIso: String\n): ParsedPhoneNumber\n```\n\nParses the associated URIs into a [ParsedPhoneNumber](/reference/kotlin/android/telephony/ParsedPhoneNumber) object.\n\nThis 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.\n\n| Parameters ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `associatedUris` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Uri](../net/Uri.html#)!\\\u003e?: 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`. |\n| `countryIso` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The country ISO code to be used for parsing. This value cannot be `null`. |\n\n| Return ||\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ParsedPhoneNumber](/reference/kotlin/android/telephony/ParsedPhoneNumber) | A [ParsedPhoneNumber](/reference/kotlin/android/telephony/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`. |"]]