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

# WifiManager.LocalOnlyConnectionFailureListener

*** ** * ** ***


`
public
static


interface
WifiManager.LocalOnlyConnectionFailureListener
`


`


`

|---|
| android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener |

<br />

*** ** * ** ***

Interface for local-only connection failure listener.
Should be implemented by applications and set when calling
`https://developer.android.com/reference/android/net/wifi/WifiManager#addLocalOnlyConnectionFailureListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener)`

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyConnectionFailureListener#onConnectionFailed(android.net.wifi.WifiNetworkSpecifier,%20int)(https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier wifiNetworkSpecifier, int failureReason) ` Called when the framework attempted to connect to a local-only network requested by the registering app, but the connection to the network failed. |

## Public methods

### onConnectionFailed

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

```
public abstract void onConnectionFailed (WifiNetworkSpecifier wifiNetworkSpecifier, 
                int failureReason)
```

Called when the framework attempted to connect to a local-only network requested by the
registering app, but the connection to the network failed.

<br />

| Parameters ||
|---|---|
| `wifiNetworkSpecifier` | `WifiNetworkSpecifier`: The `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier` which failed to connect. This value cannot be `null`. <br /> |
| `failureReason` | `int`: the connection failure reason code. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_UNKNOWN` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_ASSOCIATION` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_AUTHENTICATION` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_IP_PROVISIONING` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NOT_FOUND` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NO_RESPONSE` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_USER_REJECT` |