Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android webview not displaying '%' character

I have a WebView using following code:

WebView webView = new WebView(cont);
webView.loadData("Red 20%", "text/html", "utf-8");

It is having trouble showing the string. But if I remove the '%' character from the string it is showing properly. What is wrong with the code? How do I display '%' in WebView?

like image 340
dev_android Avatar asked Jan 27 '26 06:01

dev_android


1 Answers

Simple:

WebView webView = new WebView(cont);
webView.loadData("Red 20%", "text/html", "utf-8");

You can see the special characters here: http://www.degraeve.com/reference/specialcharacters.php

like image 186
neteinstein Avatar answered Jan 28 '26 18:01

neteinstein