code: public static boolean isWifiConnected(Context context) {
          ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
          NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
          return networkInfo != null && networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
      }
docs: This method requires the caller to hold the permission ACCESS_NETWORK_STATE.
  
  @param context context
  @return if wifi is connected,return true