Stay organized with collections
Save and categorize content based on your preferences.
LocalOnlyHotspotCallback
open class LocalOnlyHotspotCallback
Callback class for applications to receive updates about the LocalOnlyHotspot status.
Summary
Public methods |
open Unit |
LocalOnlyHotspot failed to start.
|
open Unit |
LocalOnlyHotspot start succeeded.
|
open Unit |
LocalOnlyHotspot stopped.
|
Constants
ERROR_GENERIC
static val ERROR_GENERIC: Int
Value: 2
ERROR_INCOMPATIBLE_MODE
static val ERROR_INCOMPATIBLE_MODE: Int
Value: 3
ERROR_NO_CHANNEL
static val ERROR_NO_CHANNEL: Int
Value: 1
ERROR_TETHERING_DISALLOWED
static val ERROR_TETHERING_DISALLOWED: Int
Value: 4
Public constructors
LocalOnlyHotspotCallback
LocalOnlyHotspotCallback()
Public methods
onStopped
open fun onStopped(): Unit
LocalOnlyHotspot stopped.
The LocalOnlyHotspot can be disabled at any time by the user. When this happens, applications will be notified that it was stopped. This will not be invoked when an application calls LocalOnlyHotspotReservation.close()
.
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# WifiManager.LocalOnlyHotspotCallback\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLocalOnlyHotspotCallback\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback \"View this page in Java\") \n\n```\nopen class LocalOnlyHotspotCallback\n```\n\n|---|------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.wifi.WifiManager.LocalOnlyHotspotCallback](#) |\n\nCallback class for applications to receive updates about the LocalOnlyHotspot status.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_GENERIC](#ERROR_GENERIC:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_INCOMPATIBLE_MODE](#ERROR_INCOMPATIBLE_MODE:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_NO_CHANNEL](#ERROR_NO_CHANNEL:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_TETHERING_DISALLOWED](#ERROR_TETHERING_DISALLOWED:kotlin.Int) \u003cbr /\u003e |\n\n| Public constructors ||\n|--------------------------------------------------------------------|---|\n| [LocalOnlyHotspotCallback](#LocalOnlyHotspotCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onFailed](#onFailed(kotlin.Int))`(`reason:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` LocalOnlyHotspot failed to start. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStarted](#onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation))`(`reservation:` `[WifiManager.LocalOnlyHotspotReservation](/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotReservation)!`)` LocalOnlyHotspot start succeeded. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopped](#onStopped())`()` LocalOnlyHotspot stopped. |\n\nConstants\n---------\n\n### ERROR_GENERIC\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_GENERIC: Int\n``` \n\n Value: 2\n\n### ERROR_INCOMPATIBLE_MODE\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_INCOMPATIBLE_MODE: Int\n``` \n\n Value: 3\n\n### ERROR_NO_CHANNEL\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_NO_CHANNEL: Int\n``` \n\n Value: 1\n\n### ERROR_TETHERING_DISALLOWED\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_TETHERING_DISALLOWED: Int\n``` \n\n Value: 4\n\nPublic constructors\n-------------------\n\n### LocalOnlyHotspotCallback\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nLocalOnlyHotspotCallback()\n```\n\nPublic methods\n--------------\n\n### onFailed\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onFailed(reason: Int): Unit\n```\n\nLocalOnlyHotspot failed to start.\n\nApplications can attempt to call [WifiManager.startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)](/reference/kotlin/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)) again at a later time.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `reason` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The reason for failure could be one of: [ERROR_TETHERING_DISALLOWED](#ERROR_TETHERING_DISALLOWED:kotlin.Int), [ERROR_INCOMPATIBLE_MODE](#ERROR_INCOMPATIBLE_MODE:kotlin.Int), [ERROR_NO_CHANNEL](#ERROR_NO_CHANNEL:kotlin.Int), or [ERROR_GENERIC](#ERROR_GENERIC:kotlin.Int). |\n\n### onStarted\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onStarted(reservation: WifiManager.LocalOnlyHotspotReservation!): Unit\n```\n\nLocalOnlyHotspot start succeeded. \n\n### onStopped\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onStopped(): Unit\n```\n\nLocalOnlyHotspot stopped.\n\nThe LocalOnlyHotspot can be disabled at any time by the user. When this happens, applications will be notified that it was stopped. This will not be invoked when an application calls [LocalOnlyHotspotReservation.close()](/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotReservation#close())."]]