WebView: webpage not available but I load it from an html string

前端 未结 3 607
一个人的身影
一个人的身影 2021-01-15 02:06

My html string is like this:


3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-15 02:35

    Use loadDataWithBaseURL instead.

     webView.loadDataWithBaseURL(null, html,"text/html", "UTF-8", null);
    

    Here's the discussion that has this workaround: http://code.google.com/p/android/issues/detail?id=1733

    Comments : #14 and #18

    Worked here.

提交回复
热议问题