Language

NetworkRequest.Builder.SetNetworkSpecifier Method

Definition

Overloads

Name Description
SetNetworkSpecifier(NetworkSpecifier)

Sets the optional bearer-specific network specifier.

SetNetworkSpecifier(String)

Sets the obsolete string network specifier.

SetNetworkSpecifier(NetworkSpecifier)

Sets the optional bearer-specific network specifier.

[Android.Runtime.Register("setNetworkSpecifier", "(Landroid/net/NetworkSpecifier;)Landroid/net/NetworkRequest$Builder;", "GetSetNetworkSpecifier_Landroid_net_NetworkSpecifier_Handler", ApiSince=26)]
public virtual Android.Net.NetworkRequest.Builder? SetNetworkSpecifier(Android.Net.NetworkSpecifier? networkSpecifier);
[<Android.Runtime.Register("setNetworkSpecifier", "(Landroid/net/NetworkSpecifier;)Landroid/net/NetworkRequest$Builder;", "GetSetNetworkSpecifier_Landroid_net_NetworkSpecifier_Handler", ApiSince=26)>]
abstract member SetNetworkSpecifier : Android.Net.NetworkSpecifier -> Android.Net.NetworkRequest.Builder
override this.SetNetworkSpecifier : Android.Net.NetworkSpecifier -> Android.Net.NetworkRequest.Builder

Parameters

networkSpecifier
NetworkSpecifier

The specifier, or null to clear it.

Returns

This builder.

Attributes

Exceptions

Thrown when networkSpecifier is not null and the transports of the request are not valid for a network specifier.

Remarks

A non-null network specifier requires at least one transport. Valid transport combinations depend on the Android version. Changing transports after setting the specifier can make the configuration invalid.

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.

Java documentation for android.net.NetworkRequest.Builder.setNetworkSpecifier(android.net.NetworkSpecifier).

Applies to

SetNetworkSpecifier(String)

Sets the obsolete string network specifier.

[Android.Runtime.Register("setNetworkSpecifier", "(Ljava/lang/String;)Landroid/net/NetworkRequest$Builder;", "GetSetNetworkSpecifier_Ljava_lang_String_Handler")]
public virtual Android.Net.NetworkRequest.Builder? SetNetworkSpecifier(string? networkSpecifier);
[<Android.Runtime.Register("setNetworkSpecifier", "(Ljava/lang/String;)Landroid/net/NetworkRequest$Builder;", "GetSetNetworkSpecifier_Ljava_lang_String_Handler")>]
abstract member SetNetworkSpecifier : string -> Android.Net.NetworkRequest.Builder
override this.SetNetworkSpecifier : string -> Android.Net.NetworkRequest.Builder

Parameters

networkSpecifier
String

The specifier, or null or an empty string to clear it.

Returns

This builder.

Attributes

Exceptions

Thrown when networkSpecifier is not null or empty and the transports of the request are not valid for a network specifier.

Remarks

This overload is obsolete. A nonempty specifier requires at least one transport, and valid transport combinations depend on the Android version. Use the SetNetworkSpecifier(NetworkSpecifier) overload instead.

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.

Java documentation for android.net.NetworkRequest.Builder.setNetworkSpecifier(java.lang.String).

Applies to