How to pass html string to webview on android

后端 未结 4 1017
无人共我
无人共我 2020-11-30 19:13

Hi I am parsing xml and then loading it to web view, after parsing I am creating four strings so that I could append all string to one view. I am able to get two views on th

4条回答
  •  萌比男神i
    2020-11-30 19:44

    I was using some buttons with some events, converted image file coming from server. Loading normal data wasn't working for me, converting into Base64 working just fine.

    String unencodedHtml ="'%28' is the code for '('";
    tring encodedHtml = Base64.encodeToString(unencodedHtml.getBytes(), Base64.NO_PADDING);
    webView.loadData(encodedHtml, "text/html", "base64");
    

    Find details on WebView

提交回复
热议问题