if (sr.SSID.equals(knownSSID)) {
Log.v(LOG_TAG, "found " + knownSSID + " in the scan result list");
WifiConfiguration config = new WifiConfiguration();
- config.SSID = sr.SSID;
+ config.SSID = convertToQuotedString(sr.SSID);
config.allowedKeyManagement.set(KeyMgmt.NONE);
int networkId = mWifiManager.addNetwork(config);
// Connect to network by disabling others.
context.sendBroadcast(intent);
}
+ protected static String convertToQuotedString(String string) {
+ return "\"" + string + "\"";
+ }
+
@Override
protected void onDestroy() {
super.onDestroy();