title: Android 10 connect to specific wifi but no internet connection
body: <p>I connect to wifi by code below, It can connect successful but no internet connection (android show icon network with x), don't know why.</p>
  <pre><code>WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier.Builder()
      .setSsid(ssid)
      .setWpa2Passphrase(password)
      .build();
  
  NetworkRequest networkRequest = new NetworkRequest.Builder()
          .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
          .setNetworkSpecifier(wifiNetworkSpecifier)
          .build();
  
  connectivityManager = (ConnectivityManager)activity.getSystemService(Context.CONNECTIVITY_SERVICE);
  
  networkCallback = new ConnectivityManager.NetworkCallback() {
      @Override
      public void onAvailable(@NonNull Network network) {
          super.onAvailable(network);
          connectivityManager.bindProcessToNetwork(network);
      }
  };
  connectivityManager.requestNetwork(networkRequest, networkCallback);
  </code></pre>