摘要:
写一个方法,判断网络是否可用.public static boolean isNetworkAvailable(Context context){ConnectivityManager connectivity =(ConnectivityManager ) context.getSystemService(Context.CONNECTIVITY_SERVICE);if(connectivity ==null){}else{NetworkInfo[] info = connectivity.getAllNetworkInfo(); if (info != null) {... 阅读全文