Compartilhar via


ConnectivityManager.RegisterNetworkCallback Method

Definition

Overloads

RegisterNetworkCallback(NetworkRequest, ConnectivityManager+NetworkCallback, Handler)
RegisterNetworkCallback(NetworkRequest, PendingIntent)
RegisterNetworkCallback(NetworkRequest, ConnectivityManager+NetworkCallback)

Registers to receive notifications about all networks which satisfy the given NetworkRequest.

RegisterNetworkCallback(NetworkRequest, ConnectivityManager+NetworkCallback, Handler)

[Android.Runtime.Register("registerNetworkCallback", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;Landroid/os/Handler;)V", "GetRegisterNetworkCallback_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Landroid_os_Handler_Handler", ApiSince=26)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")]
public virtual void RegisterNetworkCallback (Android.Net.NetworkRequest request, Android.Net.ConnectivityManager.NetworkCallback networkCallback, Android.OS.Handler handler);
[<Android.Runtime.Register("registerNetworkCallback", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;Landroid/os/Handler;)V", "GetRegisterNetworkCallback_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Landroid_os_Handler_Handler", ApiSince=26)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
abstract member RegisterNetworkCallback : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback * Android.OS.Handler -> unit
override this.RegisterNetworkCallback : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback * Android.OS.Handler -> unit

Parameters

request
NetworkRequest
handler
Handler
Attributes

Remarks

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

RegisterNetworkCallback(NetworkRequest, PendingIntent)

[Android.Runtime.Register("registerNetworkCallback", "(Landroid/net/NetworkRequest;Landroid/app/PendingIntent;)V", "GetRegisterNetworkCallback_Landroid_net_NetworkRequest_Landroid_app_PendingIntent_Handler", ApiSince=23)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")]
public virtual void RegisterNetworkCallback (Android.Net.NetworkRequest request, Android.App.PendingIntent operation);
[<Android.Runtime.Register("registerNetworkCallback", "(Landroid/net/NetworkRequest;Landroid/app/PendingIntent;)V", "GetRegisterNetworkCallback_Landroid_net_NetworkRequest_Landroid_app_PendingIntent_Handler", ApiSince=23)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
abstract member RegisterNetworkCallback : Android.Net.NetworkRequest * Android.App.PendingIntent -> unit
override this.RegisterNetworkCallback : Android.Net.NetworkRequest * Android.App.PendingIntent -> unit

Parameters

request
NetworkRequest
operation
PendingIntent
Attributes

Remarks

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

RegisterNetworkCallback(NetworkRequest, ConnectivityManager+NetworkCallback)

Registers to receive notifications about all networks which satisfy the given NetworkRequest.

[Android.Runtime.Register("registerNetworkCallback", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;)V", "GetRegisterNetworkCallback_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Handler")]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")]
public virtual void RegisterNetworkCallback (Android.Net.NetworkRequest request, Android.Net.ConnectivityManager.NetworkCallback networkCallback);
[<Android.Runtime.Register("registerNetworkCallback", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;)V", "GetRegisterNetworkCallback_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
abstract member RegisterNetworkCallback : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback -> unit
override this.RegisterNetworkCallback : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback -> unit

Parameters

request
NetworkRequest

NetworkRequest describing this request.

networkCallback
ConnectivityManager.NetworkCallback

The ConnectivityManager.NetworkCallback that the system will call as suitable networks change state.

Attributes

Remarks

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