android mobile twitter page in webview not opening?

前端 未结 4 1112
日久生厌
日久生厌 2021-01-02 18:21

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

相关标签:
4条回答
  • 2021-01-02 18:52

    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.

    0 讨论(0)
  • 2021-01-02 19:03

    Are you hitting a https:// page? If so, try setting a WebViewClient on your webview and override onReceivedSslError and see if there something wrong.

    Twitter changed some certificate stuff recently, if you're hitting twitter.com/... try hitting api.twitter.com/...

    0 讨论(0)
  • 2021-01-02 19:05
    wv.getSettings().setDomStorageEnabled(true);
    

    This worked for me!

    0 讨论(0)
  • 2021-01-02 19:08

    Just add this code below webview. It solved my problem.

    webView.getSettings().setJavaScriptEnabled(true);
    webView.addJavascriptInterface(this, "TwitterDownloader");
    
    0 讨论(0)
提交回复
热议问题