I am attempting to get the string representation of an Android device's current WiFi state. I am using the getWifiState()
method of the WiFiManager
and am getting an integer returned depending on the current state. This makes total sense as getWifiState()
is supposed to return an integer. The method's documentation indicates that the possible return values translate to one of the following constant values
- 0 WIFI_STATE_DISABLING
- 1 WIFI_STATE_DISABLED
- 2 WIFI_STATE_ENABLING
- 3 WIFI_STATE_ENABLED
- 4 WIFI_STATE_UNKNOWN
Is there an easy way to translate the integer returned from getWiFiState()
to a string representation? I've looked at getIntExtra
but am unsure of its use.