I am trying to use the url on facebook through an android app. I use the android web view to show a similar button, but when I click on it, nothing happens and it shows a blank page. But when I use the same URL in the Android web browser on hold and prefer the link.
I am using the following code
WebView like_btn = (WebView) findViewById(R.id.WEBView);
String url = "http://www.facebook.com/plugins/like.php?layout=standard&show_faces=true&width=80&height=50&action=like&colorscheme=light&href=http://google.com";
like_btn.loadUrl(url);
like_btn.getSettings().setJavaScriptEnabled(true);
like_btn.getSettings().setAppCacheEnabled(true);
like_btn.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
Am I doing it right or is there another way to achieve this functionality? There are other questions related to this problem, but they only say how to close a blank page. The real problem is that it doesn't even “like” the URL.
source
share