BarmanInfo
BarmanInfo

Reputation: 392

Html string not seen in webview

my html string is =

<html><head></head><body><div style='display: inline-flex; background-color: rgb(105, 105, 105); width: 180px; text-align: center;'><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> e </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> q </div><div style= 'text-align: center; height: 35px; font-family: Tahoma; font-size: 1.6em; color: rgb(161, 119, 255);'> h </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> o </div><div style= 'transform: rotate(-16deg); color: red; font-weight: 400; height: 35px; text-align: center; font-size: 3em;'> O </div><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> b </div></div></body></html>

This Html String is not load in webview. If any one have any solution please share ...

my code is:

String url_captcha="<html><head></head><body><div style='display: inline-flex; background-color: rgb(105, 105, 105); width: 180px; text-align: center;'><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> e </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> q </div><div style= 'text-align: center; height: 35px; font-family: Tahoma; font-size: 1.6em; color: rgb(161, 119, 255);'> h </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> o </div><div style= 'transform: rotate(-16deg); color: red; font-weight: 400; height: 35px; text-align: center; font-size: 3em;'> O </div><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> b </div></div></body></html>";
    String Url = url_captcha.replace("'", "\"");
    Url = Url.replace("\\", "\\\\");

    captchaAnimation();
    web_Captcha.getSettings().setJavaScriptEnabled(true);
    web_Captcha.loadData(Url, "html/text", "utf-8");

Upvotes: 2

Views: 66

Answers (1)

Nirav Ranpara
Nirav Ranpara

Reputation: 13785

String url_captcha="<html><head></head><body><div style='display: inline-flex; background-color: rgb(105, 105, 105); width: 180px; text-align: center;'><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> e </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> q </div><div style= 'text-align: center; height: 35px; font-family: Tahoma; font-size: 1.6em; color: rgb(161, 119, 255);'> h </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> o </div><div style= 'transform: rotate(-16deg); color: red; font-weight: 400; height: 35px; text-align: center; font-size: 3em;'> O </div><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> b </div></div></body></html>";    
wv.getSettings().setJavaScriptEnabled(true);
    wv.loadDataWithBaseURL(null, url_captcha, "text/html", "utf-8", null);

Upvotes: 2

Related Questions