title: Android WebView for Facebook Like Button
body: <p>I'm trying to make facebook like functionality in Android WebView (project specification does not allow browser opening, or any <em>out of application</em> activity). </p>
  
  <p>So, restrictions are that it has to be done in WebView. I've managed to make it a dialog, and apon user's click like button, it (the WebView) redirects successfully (in the same view) to facebooks login page. After successful authentication, the <code>WebView</code> (in a dialog) is redirected to <strong>blank page</strong> with facebook header.</p>
  
  <p>Interestingly enough, when user leaves the blank dialog and click again on the like button it works like perfectly (like and unlike) - it somehow keeps authentication active. To resolve the blank page, I've tried/used following:</p>
  
  <ul>
  <li>using <code>WebViewClient</code> and <code>shouldOverloadUrlForwarding</code> to keep whole process in same <code>WebView</code> dialog.</li>
  <li>using <code>WebChromeClient</code> to properly execute JavaScript - without it after login is not possible to like/unlike.</li>
  <li>tried using <code>setUserAgentString()</code> to simulate other browsers like Chrome or Firefox</li>
  <li><p>tried the SSL Error certificate handling (in API level 8) (at <code>WebViewClient</code>)</p>
  
  <p><code>@Override
          public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
              handler.proceed();
          }</code></p></li>
  <li><p>using (and all possible combination of these)</p>
  
  <p><code>webView.getSettings().setAppCacheEnabled(true);
      webView.getSettings().setJavaScriptEnabled(true);
      webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);</code></p></li>
  <li><p>Tried also persisting cookies with <code>CookieSyncManager</code>, <code>CookieManager</code> and manually handling.</p></li>
  </ul>
  
  <p>All of this was with no result. I really appreciate <strong>any</strong> help!</p>