Skip to content

Most visited

Recently visited

navigation

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


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
SCANNINGCONNECTING
CONNECTINGCONNECTING
AUTHENTICATINGCONNECTING
CONNECTEDCONNECTED
DISCONNECTINGDISCONNECTING
DISCONNECTEDDISCONNECTED
UNAVAILABLEDISCONNECTED
FAILEDDISCONNECTED

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

From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum values

CONNECTED

added in API level 1
NetworkInfo.State CONNECTED

CONNECTING

added in API level 1
NetworkInfo.State CONNECTING

DISCONNECTED

added in API level 1
NetworkInfo.State DISCONNECTED

DISCONNECTING

added in API level 1
NetworkInfo.State DISCONNECTING

SUSPENDED

added in API level 1
NetworkInfo.State SUSPENDED

UNKNOWN

added in API level 1
NetworkInfo.State UNKNOWN

Public methods

valueOf

added in API level 1
NetworkInfo.State valueOf (String name)

Parameters
name String

Returns
NetworkInfo.State

values

added in API level 1
State[] values ()

Returns
State[]

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)