判断是否为Wifi网络

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

你可能感兴趣的:(网络,service,null)