Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android mobile twitter page in webview not opening?

I am trying to open twitter page begining with https in webview in android. But it is not opening and blank screen is coming with continous loading. Screen shot is below

enter image description here

Edit: In main webview I have link to twitter page https://twitter.com/mytwitterpage. On clicking that link that twitter url is opening in webview. I noticed that onPageFinished method of WebViewClient is called 2 times one time for https://twitter.com/mytwitterpage and second time for https://mobile.twitter.com/#!/mytwitterpage.

Anyone know what is wrong here?

Thanks in advance.

like image 606
anujprashar Avatar asked Nov 08 '11 19:11

anujprashar


2 Answers

Ok done by adding below line in my code

webView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17");

I got it from this post at stackoverflow Problems loading mobile.twitter in webview.

like image 164
anujprashar Avatar answered Sep 27 '22 17:09

anujprashar


wv.getSettings().setDomStorageEnabled(true);

This worked for me!

like image 27
Abirami Avatar answered Sep 27 '22 19:09

Abirami