Remove the the network when disabling.
This commit is contained in:
parent
1f5690245d
commit
806a6d797b
1 changed files with 6 additions and 0 deletions
|
@ -169,6 +169,12 @@ public class MainActivity extends ActionBarActivity {
|
|||
|
||||
Toast.makeText(buttonView.getContext(), getString(R.string.wlan_activated), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
List<WifiConfiguration> 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();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue