Added in API level 1
Deprecated in API level 29

NetworkInfo.State


public static final enum NetworkInfo.State
extends Enum<NetworkInfo.State>

java.lang.Object
   ↳ java.lang.Enum<android.net.NetworkInfo.State>
     ↳ android.net.NetworkInfo.State


This enum was deprecated in API level 29.
See NetworkInfo.

Coarse-grained network state. This is probably what most applications should use, rather than DetailedState. The mapping between the two is as follows:

Detailed stateCoarse-grained state
IDLEDISCONNECTED
SCANNINGDISCONNECTED
CONNECTINGCONNECTING
AUTHENTICATINGCONNECTING
OBTAINING_IPADDRCONNECTING
VERIFYING_POOR_LINKCONNECTING
CAPTIVE_PORTAL_CHECKCONNECTING
CONNECTEDCONNECTED
SUSPENDEDSUSPENDED
DISCONNECTINGDISCONNECTING
DISCONNECTEDDISCONNECTED
FAILEDDISCONNECTED
BLOCKEDDISCONNECTED

Summary

Enum values

NetworkInfo.State  CONNECTED

 

NetworkInfo.State  CONNECTING

 

NetworkInfo.State  DISCONNECTED

 

NetworkInfo.State  DISCONNECTING

 

NetworkInfo.State  SUSPENDED

 

NetworkInfo.State  UNKNOWN

 

Public methods

static NetworkInfo.State valueOf(String name)
static final State[] values()

Inherited methods

Enum values

CONNECTED

Added in API level 1
public static final NetworkInfo.State CONNECTED

CONNECTING

Added in API level 1
public static final NetworkInfo.State CONNECTING

DISCONNECTED

Added in API level 1
public static final NetworkInfo.State DISCONNECTED

DISCONNECTING

Added in API level 1
public static final NetworkInfo.State DISCONNECTING

SUSPENDED

Added in API level 1
public static final NetworkInfo.State SUSPENDED

UNKNOWN

Added in API level 1
public static final NetworkInfo.State UNKNOWN

Public methods

valueOf

public static NetworkInfo.State valueOf (String name)

Parameters
name String

Returns
NetworkInfo.State

values

public static final State[] values ()

Returns
State[]