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 simple task - so I'm not sure exactly what I'm doing wrong.
I'm using the following StackOverflow post as an example:
How to forget a wireless network in android programmatically?
public class KillTimer extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.killtimer);
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
wifiManager.getConnectionInfo().getSSID()
wifiManager.getConnectionInfo().getNetoworkId();
wifiManager.removeNetwork(wifiConfig.networkId);
wifiManager.saveConfiguration();
}}