Android判断是否为Wifi网络

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    private static boolean isWifi(Context context) {  
          ConnectivityManager connectivityManager =(ConnectivityManager) context  
                .getSystemService(Context.CONNECTIVITY_SERVICE);  
          NetworkInfo activeNetworkInfo =connectivityManager.getActiveNetworkInfo();  
          if (activeNetworkInfo != null &&activeNetworkInfo.getType() == connectivityManager.TYPE_WIFI){  
             return true;  
          }  
          return false;  
        }