ConnectivityManager.RequestNetwork 方法

定义

重载

RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback, Handler, Int32)
RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback, Int32)
RequestNetwork(NetworkRequest, PendingIntent)
RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback)

请求一个网络来满足一组 NetworkCapabilities

RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback, Handler)

RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback, Handler, Int32)

[Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;Landroid/os/Handler;I)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Landroid_os_Handler_IHandler", ApiSince=26)]
public virtual void RequestNetwork (Android.Net.NetworkRequest request, Android.Net.ConnectivityManager.NetworkCallback networkCallback, Android.OS.Handler handler, int timeoutMs);
[<Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;Landroid/os/Handler;I)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Landroid_os_Handler_IHandler", ApiSince=26)>]
abstract member RequestNetwork : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback * Android.OS.Handler * int -> unit
override this.RequestNetwork : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback * Android.OS.Handler * int -> unit

参数

request
NetworkRequest
handler
Handler
timeoutMs
Int32
属性

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback, Int32)

[Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;I)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_IHandler", ApiSince=26)]
public virtual void RequestNetwork (Android.Net.NetworkRequest request, Android.Net.ConnectivityManager.NetworkCallback networkCallback, int timeoutMs);
[<Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;I)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_IHandler", ApiSince=26)>]
abstract member RequestNetwork : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback * int -> unit
override this.RequestNetwork : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback * int -> unit

参数

request
NetworkRequest
timeoutMs
Int32
属性

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

RequestNetwork(NetworkRequest, PendingIntent)

[Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/app/PendingIntent;)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_app_PendingIntent_Handler", ApiSince=22)]
public virtual void RequestNetwork (Android.Net.NetworkRequest request, Android.App.PendingIntent operation);
[<Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/app/PendingIntent;)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_app_PendingIntent_Handler", ApiSince=22)>]
abstract member RequestNetwork : Android.Net.NetworkRequest * Android.App.PendingIntent -> unit
override this.RequestNetwork : Android.Net.NetworkRequest * Android.App.PendingIntent -> unit

参数

request
NetworkRequest
operation
PendingIntent
属性

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback)

请求一个网络来满足一组 NetworkCapabilities

[Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Handler")]
public virtual void RequestNetwork (Android.Net.NetworkRequest request, Android.Net.ConnectivityManager.NetworkCallback networkCallback);
[<Android.Runtime.Register("requestNetwork", "(Landroid/net/NetworkRequest;Landroid/net/ConnectivityManager$NetworkCallback;)V", "GetRequestNetwork_Landroid_net_NetworkRequest_Landroid_net_ConnectivityManager_NetworkCallback_Handler")>]
abstract member RequestNetwork : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback -> unit
override this.RequestNetwork : Android.Net.NetworkRequest * Android.Net.ConnectivityManager.NetworkCallback -> unit

参数

request
NetworkRequest

NetworkRequest 描述此请求。

networkCallback
ConnectivityManager.NetworkCallback

ConnectivityManager.NetworkCallback要用于此请求。 请注意,回调不得共享 - 它们唯一指定此请求。

属性

例外

如果 request 指定任何可变 NetworkCapabilities值,则为

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

RequestNetwork(NetworkRequest, ConnectivityManager+NetworkCallback, Handler)

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

参数

request
NetworkRequest
handler
Handler
属性

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于