I\'m attempting to remove my wifi network programatically - however I cannot seem to get it to remove/forget the currently connected wifi connection. This should be a pretty
private void RemoveWifiNetworks() {
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
List list = wifiManager.getConfiguredNetworks();
for (WifiConfiguration i : list) {
//int networkId = wifiManager.getConnectionInfo().getNetworkId();
wifiManager.removeNetwork(i.networkId);
wifiManager.saveConfiguration();
}
}