Udostępnij za pośrednictwem


ConnectivityManager.NetworkCallback.OnLinkPropertiesChanged Method

Definition

Called when the network corresponding to this request changes LinkProperties.

[Android.Runtime.Register("onLinkPropertiesChanged", "(Landroid/net/Network;Landroid/net/LinkProperties;)V", "GetOnLinkPropertiesChanged_Landroid_net_Network_Landroid_net_LinkProperties_Handler")]
public virtual void OnLinkPropertiesChanged (Android.Net.Network network, Android.Net.LinkProperties linkProperties);
[<Android.Runtime.Register("onLinkPropertiesChanged", "(Landroid/net/Network;Landroid/net/LinkProperties;)V", "GetOnLinkPropertiesChanged_Landroid_net_Network_Landroid_net_LinkProperties_Handler")>]
abstract member OnLinkPropertiesChanged : Android.Net.Network * Android.Net.LinkProperties -> unit
override this.OnLinkPropertiesChanged : Android.Net.Network * Android.Net.LinkProperties -> unit

Parameters

network
Network

The Network whose link properties have changed.

linkProperties
LinkProperties

The new LinkProperties for this network.

Attributes

Remarks

Called when the network corresponding to this request changes LinkProperties.

Starting with android.os.Build.VERSION_CODES#O this method is guaranteed to be called immediately after #onAvailable.

Do NOT call #getNetworkCapabilities(Network) or other synchronous ConnectivityManager methods in this callback as this is prone to race conditions : calling these methods while in a callback may return an outdated or even a null object.

Java documentation for android.net.ConnectivityManager.NetworkCallback.onLinkPropertiesChanged(android.net.Network, android.net.LinkProperties).

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