pRaNaY pRaNaY - 1 year ago 73
Android Question

Android webview cant load html text

I am trying below code for webview, but i cannot get o/p in webview with given data input.

Below input text i want to view in webview.

String aboutUsString="
<p><img alt="" src="//" /></p>
<p><img alt="" src="//" /></p>
<p><img alt="" src="//" /></p>

Webview code:-

public void setWebpage() {
if (!aboutUsString.equals("")) {
webview.loadDataWithBaseURL("", aboutUsString, "text/html", "utf-8", "");

Answer Source

Try by adding the protocol(http:) to the URL you are giving to the 'p' tag. Replace the <p><img alt="" src="//" /></p> with

<p><img alt='' src='' /></p>

Hope this helps!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download