다음을 통해 공유


NetworkInfo Constructors

Definition

Overloads

NetworkInfo(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

NetworkInfo(Int32, Int32, String, String)

Create a new instance of NetworkInfo.

NetworkInfo(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected NetworkInfo (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Net.NetworkInfo : nativeint * Android.Runtime.JniHandleOwnership -> Android.Net.NetworkInfo

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

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

NetworkInfo(Int32, Int32, String, String)

Create a new instance of NetworkInfo.

[Android.Runtime.Register(".ctor", "(IILjava/lang/String;Ljava/lang/String;)V", "", ApiSince=30)]
public NetworkInfo (int type, int subtype, string? typeName, string? subtypeName);
[<Android.Runtime.Register(".ctor", "(IILjava/lang/String;Ljava/lang/String;)V", "", ApiSince=30)>]
new Android.Net.NetworkInfo : int * int * string * string -> Android.Net.NetworkInfo

Parameters

type
Int32

the legacy type of the network, as one of the ConnectivityManager.TYPE_* constants.

subtype
Int32

the subtype if applicable, as one of the TelephonyManager.NETWORK_TYPE_* constants.

typeName
String

a human-readable string for the network type, or an empty string or null.

subtypeName
String

a human-readable string for the subtype, or an empty string or null.

Attributes

Remarks

Create a new instance of NetworkInfo.

This may be useful for apps to write unit tests.

Java documentation for android.net.NetworkInfo.NetworkInfo(int, int, java.lang.String, java.lang.String).

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