Dim Dim - 1 year ago 50
Android Question

Facebook on WebView looks weird

My WebView code:

WebViewClient yourWebClient = new WebViewClient()

public boolean shouldOverrideUrlLoading(WebView view, String url)

return false;

public void onPageFinished(WebView view, String url) {

super.onPageFinished(view, url);

public void onPageStarted(WebView view, String url, Bitmap favicon) {

super.onPageStarted(view, url, favicon);

webV = (WebView)findViewById(R.id.webView);



But Facebook looks weird on it and nothing like Facebook in web mode like in chrome, it looks like this:
enter image description here

And I wish it would look like regular web Facebook.

Answer Source

It's serving up the mobile optimised version of the site. It might be possible to get round this by changing the WebView's user agent like this;

String desktopUserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100101 Firefox/4.0";

Make sure you do this before trying to load the page.