do we have any concrete answer for the WiFi network disconnection in Android Q and above versions? I am facing issue in disconnecting a specific wifi network.
- Whether Latest Android version supports direct disconnecting a wifi network?
- From my search, looks like there are restrictions but not able to conclude.
- If we can implement with our custom app, which is the best way?
Thanks.
My implementation is based on WifiNetworkSuggestion and WifiNetworkSpecifier for connection. For disconnection, i am using, on pressing the disconnect button of a Wifi, below function will get called.
fun disconnectFromWifi() { connectivityManager.unregisterNetworkCallback(networkCallback) }