Right now I'm trying to restart android wifi service after stopping it. I stop the service with the following code:
WifiManager wifiManager = ...;
wifiManager.setWifiEnabled(false);
This disables wifi when there's no lock on the wifi connection. But how do I restart the wifi service? My first approach was the following:
wifiManager.setWifiEnabled(true);
It seems like wifi is enabled after this call but the wifi service doesen't connect to available / in range WLANs. So my question is: What do I have to do to restart the wifi "autoconnect" feature?
Is it enough to just start a scan?
wifiManager.startScan();