Wish I could do a test to verify internet connection, I don\'t want check network state, because it only detects if I have activated internet on my device, y yo quiero revis
Try following:
public boolean checkOnlineState() {
ConnectivityManager CManager =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo NInfo = CManager.getActiveNetworkInfo();
if (NInfo != null && NInfo.isConnectedOrConnecting()) {
return true;
}
return false;
}
dont forget the access
else
if (InetAddress.getByName("www.xy.com").isReachable(timeout))
{ }
else
{ }