다음을 통해 공유


NetworkInfo.IsConnectedOrConnecting Property

Definition

Indicates whether network connectivity exists or is in the process of being established.

public virtual bool IsConnectedOrConnecting { [Android.Runtime.Register("isConnectedOrConnecting", "()Z", "GetIsConnectedOrConnectingHandler")] get; }
[<get: Android.Runtime.Register("isConnectedOrConnecting", "()Z", "GetIsConnectedOrConnectingHandler")>]
member this.IsConnectedOrConnecting : bool

Property Value

true if network connectivity exists or is in the process of being established, false otherwise.

Attributes

Remarks

Indicates whether network connectivity exists or is in the process of being established. This is good for applications that need to do anything related to the network other than read or write data. For the latter, call #isConnected() instead, which guarantees that the network is fully usable.

This member is deprecated. Apps should instead use the android.net.ConnectivityManager.NetworkCallback API to learn about connectivity changes. ConnectivityManager#registerDefaultNetworkCallback and ConnectivityManager#registerNetworkCallback. These will give a more accurate picture of the connectivity state of the device and let apps react more easily and quickly to changes.

Java documentation for android.net.NetworkInfo.isConnectedOrConnecting().

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