Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder to create TelephonyNetworkSpecifier
object.
Summary
Public constructors
Public methods
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-02-10 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-02-10 UTC."],[],[],null,["# TelephonyNetworkSpecifier.Builder\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/TelephonyNetworkSpecifier.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.TelephonyNetworkSpecifier.Builder](#) |\n\nBuilder to create [TelephonyNetworkSpecifier](/reference/kotlin/android/net/TelephonyNetworkSpecifier) object.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TelephonyNetworkSpecifier](/reference/kotlin/android/net/TelephonyNetworkSpecifier) | [build](#build())`()` Create a NetworkSpecifier for the cellular network request. |\n| [TelephonyNetworkSpecifier.Builder](#) | [setSubscriptionId](#setSubscriptionId(kotlin.Int))`(`subId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set the subscription id. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): TelephonyNetworkSpecifier\n```\n\nCreate a NetworkSpecifier for the cellular network request.\n\n| Return ||\n|--------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| [TelephonyNetworkSpecifier](/reference/kotlin/android/net/TelephonyNetworkSpecifier) | TelephonyNetworkSpecifier object. This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|--------------------------------------------------------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | when subscription Id is not provided through [setSubscriptionId(int)](#setSubscriptionId(kotlin.Int)). |\n\n### setSubscriptionId\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setSubscriptionId(subId: Int): TelephonyNetworkSpecifier.Builder\n```\n\nSet the subscription id.\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------|\n| `subId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The subscription Id. |\n\n| Return ||\n|----------------------------------------|-----------------------------------------------------------------------------------------------------|\n| [TelephonyNetworkSpecifier.Builder](#) | Instance of [Builder](#) to enable the chaining of the builder method. This value cannot be `null`. |"]]