Thank you Don Manfred for your answer. It doesn't give an error, it just doesn't delete the saved networks.
Two other problem is that if I run this:
wifi.connectWifiAP( "MyWiFI , ifi.SECURITY_WPA2PSK, "MyPass", 20000)
wait for Wifi_ConnectionResult (Success As Boolean)
1) the program continues its execution in activity_resume after press connection button,
2) Then If I exit of Program and re-enter to program the Wi-Fi is not connected to the specified network .