次の方法で共有


WifiManager.UpdateNetwork(WifiConfiguration) Method

Definition

Update the network description of an existing configured network.

[Android.Runtime.Register("updateNetwork", "(Landroid/net/wifi/WifiConfiguration;)I", "GetUpdateNetwork_Landroid_net_wifi_WifiConfiguration_Handler")]
public virtual int UpdateNetwork (Android.Net.Wifi.WifiConfiguration? config);
[<Android.Runtime.Register("updateNetwork", "(Landroid/net/wifi/WifiConfiguration;)I", "GetUpdateNetwork_Landroid_net_wifi_WifiConfiguration_Handler")>]
abstract member UpdateNetwork : Android.Net.Wifi.WifiConfiguration -> int
override this.UpdateNetwork : Android.Net.Wifi.WifiConfiguration -> int

Parameters

config
WifiConfiguration

the set of variables that describe the configuration, contained in a WifiConfiguration object. It may be sparse, so that only the items that are being changed are non-null. The networkId field must be set to the ID of the existing network being updated. If the WifiConfiguration has an Http Proxy set the calling app must be System, or be provisioned as the Profile or Device Owner.

Returns

Returns the networkId of the supplied WifiConfiguration on success. <br/> Returns -1 on failure, including when the networkId field of the WifiConfiguration does not refer to an existing network.

Attributes

Remarks

Update the network description of an existing configured network.

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 -1. <p> Deprecation Exemptions: <ul> <li>Device Owner (DO), Profile Owner (PO) and system apps. </ul>

Java documentation for android.net.wifi.WifiManager.updateNetwork(android.net.wifi.WifiConfiguration).

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