title: Android WebView getContentHeight() always returns 0
body: <p>I am implementing an WebView such that it can resize its height according to the content height. I tried to do the following:</p>
  
  <pre><code>WebView view = new WebView(context);
  view.loadData(htmlString, "text/html", "utf-8");
  
  view.setWebViewClient(new WebViewClient() {
      public void onPageFinished(WebView view, String url) {
          super.onPageFinished(view, url);
          Log.d("2", view.getContentheight() + "");
          // Set the height of the webview to view.getContentHeight() here?
      }
  });
  
  Log.d("1", view.getContentHeight() + "");
  </code></pre>
  
  <p>Where htmlString is a String of HTML format.</p>
  
  <p>However both the two Logs return 0.</p>
  
  <p>I am not sure if I am doing the right thing. How can I know the content height then set the height of the WebView accordingly?</p>