android 判断是否真正连接到internet(通过检测网址,需要时间)

if (InetAddress.getByName("www.xy.com").isReachable(timeout))
{    }
else
{    }
原文地址:https://www.cnblogs.com/stevenlxq/p/3405405.html