共用方式為


WifiManager.Reconnect Method

Definition

Reconnect to the currently active access point, if we are currently disconnected.

[Android.Runtime.Register("reconnect", "()Z", "GetReconnectHandler")]
public virtual bool Reconnect ();
[<Android.Runtime.Register("reconnect", "()Z", "GetReconnectHandler")>]
abstract member Reconnect : unit -> bool
override this.Reconnect : unit -> bool

Returns

true if the operation succeeded

Attributes

Remarks

Reconnect to the currently active access point, if we are currently disconnected. 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.reconnect().

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.

Applies to