Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#constants) \| [Ctors](https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#pubctors) \| [Methods](https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#inhmethods)

# WifiManager.LocalOnlyHotspotCallback

*** ** * ** ***

` public static class WifiManager.LocalOnlyHotspotCallback `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.wifi.WifiManager.LocalOnlyHotspotCallback |

<br />

*** ** * ** ***

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

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_GENERIC` <br /> |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE` <br /> |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_NO_CHANNEL` <br /> |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED` <br /> |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#LocalOnlyHotspotCallback()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onFailed(int)(int reason) ` LocalOnlyHotspot failed to start. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation)(https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotReservation reservation) ` LocalOnlyHotspot start succeeded. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStopped()() ` LocalOnlyHotspot stopped. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ERROR_GENERIC

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

```
public static final int ERROR_GENERIC
```

<br />

<br />

Constant Value: 2 (0x00000002)

### ERROR_INCOMPATIBLE_MODE

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

```
public static final int ERROR_INCOMPATIBLE_MODE
```

<br />

<br />

Constant Value: 3 (0x00000003)

### ERROR_NO_CHANNEL

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

```
public static final int ERROR_NO_CHANNEL
```

<br />

<br />

Constant Value: 1 (0x00000001)

### ERROR_TETHERING_DISALLOWED

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

```
public static final int ERROR_TETHERING_DISALLOWED
```

<br />

<br />

Constant Value: 4 (0x00000004)

## Public constructors

### LocalOnlyHotspotCallback

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

```
public LocalOnlyHotspotCallback ()
```

<br />

<br />

## Public methods

### onFailed

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

```
public void onFailed (int reason)
```

LocalOnlyHotspot failed to start.

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

<br />

<br />

| Parameters ||
|---|---|
| `reason` | `int`: The reason for failure could be one of: `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED`, `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE`, `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_NO_CHANNEL`, or `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_GENERIC`. <br /> |

### onStarted

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

```
public void onStarted (WifiManager.LocalOnlyHotspotReservation reservation)
```

LocalOnlyHotspot start succeeded.

<br />

| Parameters ||
|---|---|
| `reservation` | `WifiManager.LocalOnlyHotspotReservation` <br /> |

### onStopped

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

```
public void onStopped ()
```

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

<br />