Coarse-grained network state. This is probably what most applications should use, rather than DetailedState. The mapping between the two is as follows:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# NetworkInfo.State\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nState\n=====\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/NetworkInfo.State \"View this page in Java\") \n\n```\nclass State\n```\n\n|---|---|------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.net.NetworkInfo.State](#)\\\u003e ||\n| | ↳ | [android.net.NetworkInfo.State](#) |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [NetworkInfo.State.CONNECTED](#ENUM_VALUE:CONNECTED), [NetworkInfo.State.CONNECTING](#ENUM_VALUE:CONNECTING), [NetworkInfo.State.DISCONNECTED](#ENUM_VALUE:DISCONNECTED), [NetworkInfo.State.DISCONNECTING](#ENUM_VALUE:DISCONNECTING), [NetworkInfo.State.SUSPENDED](#ENUM_VALUE:SUSPENDED), [NetworkInfo.State.UNKNOWN](#ENUM_VALUE:UNKNOWN) |--------------------------------------------------------------|--------| | [NetworkInfo.State.CONNECTED](#ENUM_VALUE:CONNECTED) | \u003cbr /\u003e | | [NetworkInfo.State.CONNECTING](#ENUM_VALUE:CONNECTING) | \u003cbr /\u003e | | [NetworkInfo.State.DISCONNECTED](#ENUM_VALUE:DISCONNECTED) | \u003cbr /\u003e | | [NetworkInfo.State.DISCONNECTING](#ENUM_VALUE:DISCONNECTING) | \u003cbr /\u003e | | [NetworkInfo.State.SUSPENDED](#ENUM_VALUE:SUSPENDED) | \u003cbr /\u003e | | [NetworkInfo.State.UNKNOWN](#ENUM_VALUE:UNKNOWN) | \u003cbr /\u003e | |\n\n*** ** * ** ***\n\n| **This enum was deprecated in API level 29.**\n|\n| See [NetworkInfo](/reference/kotlin/android/net/NetworkInfo).\n\nCoarse-grained network state. This is probably what most applications should use, rather than [DetailedState](/reference/kotlin/android/net/NetworkInfo.DetailedState). The mapping between the two is as follows: \n\n\n|------------------------|--------------------------|\n| **Detailed state** | **Coarse-grained state** |\n| `IDLE` | `DISCONNECTED` |\n| `SCANNING` | `DISCONNECTED` |\n| `CONNECTING` | `CONNECTING` |\n| `AUTHENTICATING` | `CONNECTING` |\n| `OBTAINING_IPADDR` | `CONNECTING` |\n| `VERIFYING_POOR_LINK` | `CONNECTING` |\n| `CAPTIVE_PORTAL_CHECK` | `CONNECTING` |\n| `CONNECTED` | `CONNECTED` |\n| `SUSPENDED` | `SUSPENDED` |\n| `DISCONNECTING` | `DISCONNECTING` |\n| `DISCONNECTED` | `DISCONNECTED` |\n| `FAILED` | `DISCONNECTED` |\n| `BLOCKED` | `DISCONNECTED` |\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| Enum values ||\n|---------------------------------------------------|---|\n| [CONNECTED](#ENUM_VALUE:CONNECTED) \u003cbr /\u003e |\n| [CONNECTING](#ENUM_VALUE:CONNECTING) \u003cbr /\u003e |\n| [DISCONNECTED](#ENUM_VALUE:DISCONNECTED) \u003cbr /\u003e |\n| [DISCONNECTING](#ENUM_VALUE:DISCONNECTING) \u003cbr /\u003e |\n| [SUSPENDED](#ENUM_VALUE:SUSPENDED) \u003cbr /\u003e |\n| [UNKNOWN](#ENUM_VALUE:UNKNOWN) \u003cbr /\u003e |\n\nEnum values\n-----------\n\n### CONNECTED\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val CONNECTED : NetworkInfo.State\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### CONNECTING\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val CONNECTING : NetworkInfo.State\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### DISCONNECTED\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val DISCONNECTED : NetworkInfo.State\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### DISCONNECTING\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val DISCONNECTING : NetworkInfo.State\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### SUSPENDED\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val SUSPENDED : NetworkInfo.State\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### UNKNOWN\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val UNKNOWN : NetworkInfo.State\n```\n\n**Deprecated:** *Deprecated in Java.*"]]