ConnectivityManager.NetworkCallback.OnCapabilitiesChanged 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.
Called when the network corresponding to this request changes capabilities but still satisfies the requested criteria.
[Android.Runtime.Register("onCapabilitiesChanged", "(Landroid/net/Network;Landroid/net/NetworkCapabilities;)V", "GetOnCapabilitiesChanged_Landroid_net_Network_Landroid_net_NetworkCapabilities_Handler")]
public virtual void OnCapabilitiesChanged (Android.Net.Network network, Android.Net.NetworkCapabilities networkCapabilities);
[<Android.Runtime.Register("onCapabilitiesChanged", "(Landroid/net/Network;Landroid/net/NetworkCapabilities;)V", "GetOnCapabilitiesChanged_Landroid_net_Network_Landroid_net_NetworkCapabilities_Handler")>]
abstract member OnCapabilitiesChanged : Android.Net.Network * Android.Net.NetworkCapabilities -> unit
override this.OnCapabilitiesChanged : Android.Net.Network * Android.Net.NetworkCapabilities -> unit
Parameters
- network
- Network
The Network
whose capabilities have changed.
- networkCapabilities
- NetworkCapabilities
The new NetworkCapabilities
for this
network.
- Attributes
Remarks
Called when the network corresponding to this request changes capabilities but still satisfies the requested criteria.
Starting with android.os.Build.VERSION_CODES#O
this method is guaranteed to be called immediately after #onAvailable
.
Do NOT call #getLinkProperties(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.
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.