I used this code to check internet is available or not..
ConnectivityManager connectivity = (ConnectivityManager) _context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null) {
NetworkInfo[] info = connectivity.getAllNetworkInfo();
if (info != null)
for (int i = 0; i < info.length; i++)
if (info[i].getState() == NetworkInfo.State.CONNECTED && info[i].isAvailable())
{
return true;
}
}
return false;
But what i want is:
Suppose wifi is connected but no internet in wifi... how to check internet data is available in wifi eventhough Wifi is connected..if i use abouve code it just checks whether wifi is connected or disconnected.. it will be thankful if some gives me a solution...