Share via


ConnectivityManager.ActiveNetwork Property

Definition

Returns a Network object corresponding to the currently active default data network.

public virtual Android.Net.Network? ActiveNetwork { [Android.Runtime.Register("getActiveNetwork", "()Landroid/net/Network;", "GetGetActiveNetworkHandler", ApiSince=23)] [Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")] get; }
[<get: Android.Runtime.Register("getActiveNetwork", "()Landroid/net/Network;", "GetGetActiveNetworkHandler", ApiSince=23)>]
[<get: Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
member this.ActiveNetwork : Android.Net.Network

Property Value

a Network object for the current default network or null if no default network is currently active or if the default network is blocked for the caller

Attributes

Remarks

Returns a Network object corresponding to the currently active default data network. In the event that the current active default data network disconnects, the returned Network object will no longer be usable. This will return null when there is no default network, or when the default network is blocked.

Java documentation for android.net.ConnectivityManager.getActiveNetwork().

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