android turning on wifi programmatically
问题 I am trying to turn add a wifi network programmatically and to connect to that network. My code works fine if the wi-fi is already turned on. If wi-fi is off, what i see wifimanager.addtonetwork() fails and when i see the wifi settings for the phone, i can see the status as scanning If i try to connect again it works fine. Please see code below. Please help private int changeNetwork(NetworkSetting setting) { // If the SSID is empty, throw an error and return if (setting.getSsid() == null ||