title: WifiConfiguration enable network in Lollipop
body: <p>I was working on Wifi project, there is a module that enable user to join wifi programatically.</p>
  
  <p>In kitkat and below it's working successfully, but in Lollipop it's not working.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
  WifiConfiguration wifiConfiguration = new WifiConfiguration();
  wifiConfiguration.SSID = "\"testSSID\"";
  wifiConfiguration.hiddenSSID = true;
  wifiConfiguration.status = WifiConfiguration.Status.ENABLED;
  wifiConfiguration.allowedKeyManagement
  .set(WifiConfiguration.KeyMgmt.NONE);
  netId = wifiManager.addNetwork(wifiConfiguration);
  Log.d("WifiPreference", "add Network returned " + netId);
  boolean checkEnableWifi = wifiManager.enableNetwork(netId, true);
  Log.d("WifiPreference", "enableNetwork returned " + checkEnableWifi);
  </code></pre>
  
  <p>my tested device is nexus 5 build number LRX21O, is ther something wrong in my code or bug on Lollipop?</p>