Stay organized with collections
Save and categorize content based on your preferences.
LocalOnlyConnectionFailureListener
interface LocalOnlyConnectionFailureListener
Interface for local-only connection failure listener. Should be implemented by applications and set when calling WifiManager.addLocalOnlyConnectionFailureListener(Executor, LocalOnlyConnectionFailureListener)
Summary
Public methods |
abstract Unit |
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
abstract fun onConnectionFailed(
wifiNetworkSpecifier: WifiNetworkSpecifier,
failureReason: Int
): Unit
Called when the framework attempted to connect to a local-only network requested by the registering app, but the connection to the network failed.
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.
[[["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-02-10 UTC."],[],[],null,["# WifiManager.LocalOnlyConnectionFailureListener\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLocalOnlyConnectionFailureListener\n==================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/wifi/WifiManager.LocalOnlyConnectionFailureListener \"View this page in Java\") \n\n```\ninterface LocalOnlyConnectionFailureListener\n```\n\n|----------------------------------------------------------------------|\n| [android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener](#) |\n\nInterface for local-only connection failure listener. Should be implemented by applications and set when calling [WifiManager.addLocalOnlyConnectionFailureListener(Executor, LocalOnlyConnectionFailureListener)](/reference/kotlin/android/net/wifi/WifiManager#addLocalOnlyConnectionFailureListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener))\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onConnectionFailed](#onConnectionFailed(android.net.wifi.WifiNetworkSpecifier,%20kotlin.Int))`(`wifiNetworkSpecifier:` `[WifiNetworkSpecifier](/reference/kotlin/android/net/wifi/WifiNetworkSpecifier)`, `failureReason:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when the framework attempted to connect to a local-only network requested by the registering app, but the connection to the network failed. |\n\nPublic methods\n--------------\n\n### onConnectionFailed\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onConnectionFailed(\n wifiNetworkSpecifier: WifiNetworkSpecifier, \n failureReason: Int\n): Unit\n```\n\nCalled when the framework attempted to connect to a local-only network requested by the registering app, but the connection to the network failed.\n\n| Parameters ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `wifiNetworkSpecifier` | [WifiNetworkSpecifier](/reference/kotlin/android/net/wifi/WifiNetworkSpecifier): The [WifiNetworkSpecifier](/reference/kotlin/android/net/wifi/WifiNetworkSpecifier) which failed to connect. This value cannot be `null`. |\n| `failureReason` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the connection failure reason code. Value is [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_UNKNOWN](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_UNKNOWN:kotlin.Int), [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_ASSOCIATION](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_ASSOCIATION:kotlin.Int), [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_AUTHENTICATION](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_AUTHENTICATION:kotlin.Int), [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_IP_PROVISIONING](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_IP_PROVISIONING:kotlin.Int), [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NOT_FOUND](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NOT_FOUND:kotlin.Int), [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NO_RESPONSE](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NO_RESPONSE:kotlin.Int), or [android.net.wifi.WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_USER_REJECT](/reference/kotlin/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_USER_REJECT:kotlin.Int) |"]]