Stay organized with collections
Save and categorize content based on your preferences.
StartTetheringCallback
interface StartTetheringCallback
Callback for use with startTethering
to find out whether tethering succeeded.
Summary
Public methods |
open Unit |
Called when starting tethering failed.
|
open Unit |
Called when tethering has been successfully started.
|
Public methods
onTetheringFailed
open fun onTetheringFailed(error: Int): Unit
Called when starting tethering failed.
onTetheringStarted
open fun onTetheringStarted(): Unit
Called when tethering has been successfully started.
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-03-13 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-03-13 UTC."],[],[],null,["# TetheringManager.StartTetheringCallback\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nStartTetheringCallback\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/TetheringManager.StartTetheringCallback \"View this page in Java\") \n\n```\ninterface StartTetheringCallback\n```\n\n|----------------------------------------------------------|\n| [android.net.TetheringManager.StartTetheringCallback](#) |\n\nCallback for use with [startTethering](/reference/kotlin/android/net/TetheringManager#startTethering(android.net.TetheringManager.TetheringRequest,%20java.util.concurrent.Executor,%20android.net.TetheringManager.StartTetheringCallback)) to find out whether tethering succeeded.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTetheringFailed](#onTetheringFailed(kotlin.Int))`(`error:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when starting tethering failed. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTetheringStarted](#onTetheringStarted())`()` Called when tethering has been successfully started. |\n\nPublic methods\n--------------\n\n### onTetheringFailed\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onTetheringFailed(error: Int): Unit\n```\n\nCalled when starting tethering failed.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The error that caused the failure. Value is [android.net.TetheringManager#TETHER_ERROR_SERVICE_UNAVAIL](/reference/kotlin/android/net/TetheringManager#TETHER_ERROR_SERVICE_UNAVAIL:kotlin.Int), [android.net.TetheringManager#TETHER_ERROR_UNSUPPORTED](/reference/kotlin/android/net/TetheringManager#TETHER_ERROR_UNSUPPORTED:kotlin.Int), [android.net.TetheringManager#TETHER_ERROR_INTERNAL_ERROR](/reference/kotlin/android/net/TetheringManager#TETHER_ERROR_INTERNAL_ERROR:kotlin.Int), [android.net.TetheringManager#TETHER_ERROR_NO_CHANGE_TETHERING_PERMISSION](/reference/kotlin/android/net/TetheringManager#TETHER_ERROR_NO_CHANGE_TETHERING_PERMISSION:kotlin.Int), [android.net.TetheringManager#TETHER_ERROR_UNKNOWN_TYPE](/reference/kotlin/android/net/TetheringManager#TETHER_ERROR_UNKNOWN_TYPE:kotlin.Int), or [android.net.TetheringManager#TETHER_ERROR_DUPLICATE_REQUEST](/reference/kotlin/android/net/TetheringManager#TETHER_ERROR_DUPLICATE_REQUEST:kotlin.Int) |\n\n### onTetheringStarted\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onTetheringStarted(): Unit\n```\n\nCalled when tethering has been successfully started."]]