How to check if the device is connected to internet or it is just connected to external wifi network? Because NetworkInfo returns true if a device is connected to an external wifi network even there is no network connection.

When device is connected to wifi but there is no internet access,my app's network connectivity-check class returns true but application crashes with the exception that it cannot access the corresponding http url.