procedure TfrmApp.RemoveWifiList;
var
WifiManagerObj: JObject;
WifiManager: JWifiManager;
List: JList;
i: Integer;
LWifiConf: JWifiConfiguration;
LSsid:
String;
LNetId: Integer;
begin
try
WifiManagerObj := SharedActivityContext.getSystemService(TJContext.JavaClass.WIFI_SERVICE);
WifiManager := TJWifiManager.Wrap((WifiManagerObj
as ILocalObject).GetObjectID);
List := WifiManager.getConfiguredNetworks;
for i := 0
to List.size -1
do
begin
LWifiConf := TJWifiConfiguration.Wrap( List.get(i) );
LSsid := JStringToString( LWifiConf.SSID );
LNetId := LWifiConf.networkId;
WifiManager.removeNetwork( LNetId );
WifiManager.disableNetwork(LNetId);
WifiManager.disconnect;
WifiManager.saveConfiguration();
end;
except
on E:
exception do
begin
ShowMessage('
Remove: '+E.
Message);
end;
end;
end;