Reputation: 1293
in my android application I have a webView but when I made this code:
webViewopresentation.loadData("<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><body> <p><span style=\"color:#FF0000\">Привет, как дела?</span></p> </body></html>", "text/html", "UTF-8");
it shows me this text.
Привет, как дела?
What is the problem please?
Upvotes: 1
Views: 229
Reputation: 143
I did it using assets, just keep your html page in asset folder with following text
<html> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8"> <body> <p> <span style = " color: # FF0000 "> Привет, как дела </ span> </ p> </ body> </ html>
and then load that html page in your webview (view)
view.loadUrl("file:///android_asset/newhtml.html");
Upvotes: 0
Reputation: 724
try to use it
webViewopresentation.loadDataWithBaseURL(null, text,"text/html", "UTF-8", null);
Upvotes: 2