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

前端 未结 6 1399
暖寄归人
暖寄归人 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:11

    Use this code, it will work.

    String newhtml_code = Base64.encodeToString(html_code.getBytes(), Base64.NO_PADDING);
            testWebView.loadData(newhtml_code,"text/html", "base64");
    

提交回复
热议问题