网络判断
程序员文章站
2022-06-05 20:39:12
...
public class NetUtil {
public static boolean isNetWork(Context context)
{
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(context.CONNECTIVITY_SERVICE);
NetworkInfo info = manager.getActiveNetworkInfo();
if (info!=null)
{
return info.isAvailable();
}
return false;
}
}
上一篇: 判断网络
下一篇: NoSql--Mongodb简介