I am using the elow code to connect to wifi. This works if the selected ssid has internet connection but not if ssid does not has internet connection
private void