Connecting to specific wifi sometimes fails on android -
i creating app, can list out available wifi's in listview. if select 1 of wifi's in list, cached before in list<wificonfiguration> list = wifimanager.getconfigurednetworks(); should connect it. if wificonfiguration list doesn't contain selected wifi, nothing happens. problem is, select wifi list (which know sure in wificonfiguration list), doesn't connects it. instead connects connected wifi. after attempts (selecting again , again same wifi) connects finally. doesn't happen always, sometimes. can problem? here code snippet: // go through cached wifis , check if selected gopro cached before (wificonfiguration config : configurations) { // if cached connect , that's if (config.ssid != null && config.ssid.equals("\"" + mdrawerlistview.getadapter().getitem(position) + "\"")) { // log log.i("onreceive", "connecting to: " + config.ssid); mwifimanager.disconnect();