androidfacebookcommentsintegrate

Integrate Comment Feature using Facebook Sdk?


I am able to Integrate the Comment Feature in the Application but When i Click on the Login Button ,it Doesnot Work out.I am using WebView to Display the Comment. Why my Click event in Login is not Working??

want to achieve enter image description here

Click on Login is not Working.List of Comment are Displayed

Rate_And_Review

   public static String BASE_DOMAIN = "http://www.facebook.com";
    public static String PATH_URL = "/patanheritage.walk.16";
    String APP_KEY = "175417393005037";
        webViewComment = (WebView) findViewById(R.id.webView_Comment);
        webViewComment.getSettings().setJavaScriptEnabled(true);
        webViewComment.getSettings().setDomStorageEnabled(true);
        webViewComment.loadDataWithBaseURL(BASE_DOMAIN,
                "<html><head></head><body><div id=\"fb-root\"></div><div id=\"fb-root\"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = \"http://connect.facebook.net/en_US/all.js#xfbml=1&appId=" + APP_KEY + "\";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class=\"fb-comments\" data-href=\""
                        + BASE_DOMAIN + PATH_URL + "\" data-width=\"470\"></div> </body></html>", "text/html", null, null);
        webViewComment.setWebViewClient(new WebViewClientActivity());

class WebViewClientActivity extends WebViewClient {
    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        System.out.println("onPageStarted: " + url);

    }

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {

        return true;
    }

    @Override
    public void onPageFinished(WebView webView, String url) {
        System.out.println("onPageFinished: " + url);

    }
}

Why the Click to Login is not Working?How can this be Achieved.


Solution

  • You might be missing this function try this it will work fine

    @Override
       public boolean shouldOverrideUrlLoading(WebView view, String url) {
           view.loadUrl(url);
           return true;
       }