NetworkConnectionState
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
列舉 |
NETWORK_CONNECTION_STATE_UNSPECIFIED |
未指定網路連線狀態。 |
ONLINE |
網路已連線,且可以使用網際網路連線。 |
CONNECTED |
網路已連線,且未處於偵測到的入口網站狀態,但可能無法連上網際網路。 |
PORTAL |
已連上網路,但偵測到入口網站狀態。網際網路連線可能受到限制。 |
CONNECTING |
網路正在連線中。 |
NOT_CONNECTED |
未連上網路。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eIndicates the current state of the network connection, ranging from unspecified to specific states like online or disconnected.\u003c/p\u003e\n"],["\u003cp\u003eIncludes states like \u003ccode\u003eONLINE\u003c/code\u003e for internet access, \u003ccode\u003eCONNECTED\u003c/code\u003e for network access without guaranteed internet, and \u003ccode\u003ePORTAL\u003c/code\u003e for captive portals.\u003c/p\u003e\n"],["\u003cp\u003eProvides states for active connection processes (\u003ccode\u003eCONNECTING\u003c/code\u003e) and a lack of connection (\u003ccode\u003eNOT_CONNECTED\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eUses specific enums to represent each network connection state, allowing for programmatic checks and actions.\u003c/p\u003e\n"]]],[],null,["# NetworkConnectionState\n\nNetwork connection state.\n\n| Enums ||\n|----------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| `NETWORK_CONNECTION_STATE_UNSPECIFIED` | Network connection state unspecified. |\n| `ONLINE` | The network is connected and internet connectivity is available. |\n| `CONNECTED` | The network is connected and not in a detected portal state, but internet connectivity may not be available. |\n| `PORTAL` | The network is connected but a portal state was detected. Internet connectivity may be limited. |\n| `CONNECTING` | The network is in the process of connecting. |\n| `NOT_CONNECTED` | The network is not connected. |"]]