Android, automatically connecting to wifi networks that have no internet access
问题 I'm calling the function WifiManager.addNetwork(WifiConfiguration) to try and add an adhoc wifi network to the device's wifi configurations. But on Android M this function returns -1, I'm assuming because it doesn't have internet access. It works fine on most other devices. Below is code snippet I'm using. WifiConfiguration wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = '\"' + ssid + '\"'; wifiConfiguration.hiddenSSID = false; wifiConfiguration.allowedKeyManagement.set