ConnectivityManager.NetworkCallback.OnBlockedStatusChanged 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 access to the specified network is blocked or unblocked.
[Android.Runtime.Register("onBlockedStatusChanged", "(Landroid/net/Network;Z)V", "GetOnBlockedStatusChanged_Landroid_net_Network_ZHandler", ApiSince=29)]
public virtual void OnBlockedStatusChanged (Android.Net.Network network, bool blocked);
[<Android.Runtime.Register("onBlockedStatusChanged", "(Landroid/net/Network;Z)V", "GetOnBlockedStatusChanged_Landroid_net_Network_ZHandler", ApiSince=29)>]
abstract member OnBlockedStatusChanged : Android.Net.Network * bool -> unit
override this.OnBlockedStatusChanged : Android.Net.Network * bool -> unit
Parameters
- network
- Network
The Network
whose blocked status has changed.
- blocked
- Boolean
The blocked status of this Network
.
- Attributes
Remarks
Called when access to the specified network is blocked or unblocked.
Do NOT call #getNetworkCapabilities(Network)
or #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.