title: wifi.getDhcpInfo() in Android returns the wrong IP gateway
body: <p>I am writing an Android application that needs to connect to different Wifi networks based on the user's selection. I need to retrieve the gateway IP address from the networkInfo. The Problem I am facing is that if I am connected to wifi network configuration A, and then want to switch to network configuration B, the wifi.getDhcpInfo(); returns to gateway IP address of network A. After several tries through the User interface workflow, it eventually returns the gateway IP of network B. Code snipet is below. Any ideas how to determine when the newly enabled network will return accurate Dhcp information so that I can get it reliably. Is there an ansynchronous event that I can catch for example, etc.  Thanks. </p>
  
  <pre><code>WifiConfiguration config = wifiConfiguredNetworks.get(SSID);
  enableNetworkResult = false;
  enableNetworkResult = wifi.enableNetwork(config.networkId,true);
  if (enableNetworkResult == true) {
      this.networkInfo = wifi.getDhcpInfo(); // does not return proper IP info    
      this.DeviceIP = android.text.format.Formatter.formatIpAddress(networkInfo.gateway);
  }
  </code></pre>