# WifiManager.LocalOnlyHotspotCallback

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# LocalOnlyHotspotCallback

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback "View this page in Java")  

```
open class LocalOnlyHotspotCallback
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                 ||
| ↳ | [android.net.wifi.WifiManager.LocalOnlyHotspotCallback](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#) |

Callback class for applications to receive updates about the LocalOnlyHotspot status.

## Summary

|                                                                                                                             Constants                                                                                                                             ||
|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_GENERIC](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_GENERIC:kotlin.Int) <br />                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_INCOMPATIBLE_MODE](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE:kotlin.Int) <br />       |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_NO_CHANNEL](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_NO_CHANNEL:kotlin.Int) <br />                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_TETHERING_DISALLOWED](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED:kotlin.Int) <br /> |

|                                                                            Public constructors                                                                            ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [LocalOnlyHotspotCallback](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#LocalOnlyHotspotCallback())`()` <br /> |

|                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onFailed](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onFailed(kotlin.Int))`(`reason:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` LocalOnlyHotspot failed to start.                                                                                                                               |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStarted](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation))`(`reservation:` `[WifiManager.LocalOnlyHotspotReservation](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotReservation)!`)` LocalOnlyHotspot start succeeded. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopped](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStopped())`()` LocalOnlyHotspot stopped.                                                                                                                                                                                                                                     |

## Constants

### ERROR_GENERIC

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ERROR_GENERIC: Int
```  

    Value: 2

### ERROR_INCOMPATIBLE_MODE

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ERROR_INCOMPATIBLE_MODE: Int
```  

    Value: 3

### ERROR_NO_CHANNEL

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ERROR_NO_CHANNEL: Int
```  

    Value: 1

### ERROR_TETHERING_DISALLOWED

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ERROR_TETHERING_DISALLOWED: Int
```  

    Value: 4

## Public constructors

### LocalOnlyHotspotCallback

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
LocalOnlyHotspotCallback()
```

## Public methods

### onFailed

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onFailed(reason: Int): Unit
```

LocalOnlyHotspot failed to start.

Applications can attempt to call[WifiManager.startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler))again at a later time.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                   Parameters                                                                                                                                                                                                                                                                                                                                                                                    ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `reason` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The reason for failure could be one of:[ERROR_TETHERING_DISALLOWED](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED:kotlin.Int),[ERROR_INCOMPATIBLE_MODE](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE:kotlin.Int),[ERROR_NO_CHANNEL](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_NO_CHANNEL:kotlin.Int), or[ERROR_GENERIC](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_GENERIC:kotlin.Int). |

### onStarted

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onStarted(reservation: WifiManager.LocalOnlyHotspotReservation!): Unit
```

LocalOnlyHotspot start succeeded.  

### onStopped

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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()](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.LocalOnlyHotspotReservation#close()).