共用方式為


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要用於此要求的 。 請注意,回呼不得共用 - 它們會唯一指定此要求。

屬性

例外狀況

如果 指定任何可變動的 NetworkCapabilities,則request為 。

備註

此頁面的部分是根據 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 屬性授權中所述的詞彙使用。

適用於