diff --git a/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java b/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java index 1ada524..8d81875 100644 --- a/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java +++ b/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java @@ -169,6 +169,12 @@ public class MainActivity extends ActionBarActivity { Toast.makeText(buttonView.getContext(), getString(R.string.wlan_activated), Toast.LENGTH_SHORT).show(); } else { + List list = wifiManager.getConfiguredNetworks(); + for (WifiConfiguration i : list) { + if (i.SSID != null && i.SSID.equals(networkSSID)) { + wifiManager.removeNetwork(i.networkId); + } + } Toast.makeText(buttonView.getContext(), getString(R.string.wlan_deactivated), Toast.LENGTH_SHORT).show(); } }