Freigeben über


WifiManager.RemoveNetwork(Int32) Method

Definition

Remove the specified network from the list of configured networks.

[Android.Runtime.Register("removeNetwork", "(I)Z", "GetRemoveNetwork_IHandler")]
public virtual bool RemoveNetwork (int netId);
[<Android.Runtime.Register("removeNetwork", "(I)Z", "GetRemoveNetwork_IHandler")>]
abstract member RemoveNetwork : int -> bool
override this.RemoveNetwork : int -> bool

Parameters

netId
Int32

the ID of the network as returned by #addNetwork or #getConfiguredNetworks.

Returns

true if the operation succeeded

Attributes

Remarks

Remove the specified network from the list of configured networks. This may result in the asynchronous delivery of state change events.

Applications are not allowed to remove networks created by other applications.

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.removeNetwork(int).

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