How to get hotspot name while wifi is disable in android 9 or upper version
I want to get the hotspot name while my wifi is disabled but mobile data & hotspot are enabled I tried the below code but not working.
val wifiManager = getSystemService(Context.WIFI_SERVICE) as WifiManager
if (wifiManager.isWifiApEnabled) {
val ssid = wifiManager.wifiApConfiguration?.SSID
if (ssid != null) {
// Here, 'ssid' contains the SSID (name) of your hotspot
}
} else {
// Hotspot is not enabled
}
Thanks in advanced