Webview's loadData() is not working in android 10.0 (Q)

前端 未结 6 1423
暖寄归人
暖寄归人 2021-01-19 06:16

Here i am trying to load Html code as string in webview\'s loadData() .Nothing is happen over this mehtod but same method is working like charm in below sdk 29.

6条回答
  •  醉酒成梦
    2021-01-19 07:07

    I facing the same issue and fix it by using loadDataWithBaseURL() instead loadData() method

    mWebView.loadData(mHtml, "text/html", "UTF-8");
    

    solution:

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

提交回复
热议问题