Solved, gimme a lot of "helpful" for this answer because it's really a nasty webview bug and I think my answer will help a lot of you!
If your html page contains, indeed, one of "%","\" or "#" characters, loadData() method will fail!!
So you have to manually replace these chr and here's my class:
public class BuglessWebView extends WebView{
public BuglessWebView(Context context) {
super(context);
}
public BuglessWebView(Context context,AttributeSet attributes){
super(context,attributes);
}
public BuglessWebView(Context context,AttributeSet attributes,int defStyles){
super(context,attributes,defStyles);
}
@Override
public void loadData(String data, String mimeType, String encoding) {
super.loadData(solveBug(data), mimeType, encoding);
}
private String solveBug(String data){
StringBuilder sb = new StringBuilder(data.length()+100);
char[] dataChars = data.toCharArray();
for(int i=0;i<dataChars.length;i++){
char ch = data.charAt(i);
switch(ch){
case '%':
sb.append("%25");
break;
case '\'':
sb.append("%27");
break;
case '#':
sb.append("%23");
break;
default:
sb.append(ch);
break;
}
}
return sb.toString();
}
}
here's discussion link on google code: http://code.google.com/p/android/issues/detail?id=1733