WifiManager.Disconnect Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Disassociate from the currently active access point.
[Android.Runtime.Register("disconnect", "()Z", "GetDisconnectHandler")]
public virtual bool Disconnect ();
[<Android.Runtime.Register("disconnect", "()Z", "GetDisconnectHandler")>]
abstract member Disconnect : unit -> bool
override this.Disconnect : unit -> bool
Returns
true
if the operation succeeded
- Attributes
Remarks
Disassociate from the currently active access point. This may result in the asynchronous delivery of state change events.
This member is deprecated. a) See WifiNetworkSpecifier.Builder#build()
for new mechanism to trigger connection to a Wi-Fi network. b) See #addNetworkSuggestions(List)
, #removeNetworkSuggestions(List)
for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. <b>Compatibility Note:</b> For applications targeting android.os.Build.VERSION_CODES#Q
or above, this API will always fail and return false
. <p> Deprecation Exemptions: <ul> <li>Device Owner (DO), Profile Owner (PO) and system apps. </ul>
Java documentation for android.net.wifi.WifiManager.disconnect()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.