Opening new android activity with a webview shows a blank (white) screen instead of the html content

前端 未结 11 1474
野性不改
野性不改 2020-12-29 03:29

I have been researching for 2 days and I haven\'t found a similar problem anywhere on the internet!

From the main activity, I\'m trying to open a new activity contai

相关标签:
11条回答
  • 2020-12-29 04:19

    Use this

    browser_rn.loadDataWithBaseURL(url); 
    

    instead of

    browser_rn.loadUrl("file:///android_asset/about.html");
    
    0 讨论(0)
  • 2020-12-29 04:19

    meet same problem.

    I tried the solutions in link. It failed all the time.

    My situation is same to it. There is H5 video in webview,It does well first time and fail then. when It fails,I found some message from log

    1. onProgressChanged and not to 100% whitout more progress
    2. chromium: [ERROR:in_process_view_renderer.cc(193)] Failed to request GL process. Deadlock likely: 0

    when I invoke method

    mWebView.loadUrl(url)//webview's height is 0px now
    //some code change webView's height here
    

    My solutions is set webview height some dp or match_parent default. It works well!

    0 讨论(0)
  • 2020-12-29 04:22

    try change in your code

     public boolean shouldOverrideUrlLoading(WebView view, String url) { 
                            return true; 
            } 
    

    Have a look at this tutorial.

    0 讨论(0)
  • 2020-12-29 04:25

    Add following line in your activity which contains WebView activity android:hardwareAccelerated="false"

    hope it will help

    0 讨论(0)
  • 2020-12-29 04:27

    I updated last week from 2.3.4 to 4.0 on my HTC Sensation. The two apps i wrote had a local HTML-Contact site. On 2.3 it ran fine, now i get a "Webpage not available" site.

    I found another post here on this site with the comment: "Via some discussion with a Google engineer it seems that they've made the decision that the file:// scheme is insecure."

    See here for the workaround: Android 4.0.1 breaks WebView HTML 5 local storage?

    0 讨论(0)
提交回复
热议问题