private static boolean isNetAvailable(Context context){
ConnectivityManager manager= (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info=manager.getActiveNetworkInfo();
return info== null ? false:true;
}
判断网络是否可用的方法
最新推荐文章于 2022-03-20 19:02:30 发布