我不认为这是重复的,但this question可能是相关的。WebView在Android 2.3.3上工作,在4.0.1上显示空白页面
至于标题:这适用于android 2.3.3,在4.0.1上随机显示一个空白页。 它通常首先工作,然后开始显示空白页面,直到重新安装应用程序 。
的代码我用来显示简单的(仅HTML)的网页是一个如下所示:
@Override
public void afterTextChanged(final Editable arg0){
final String result = getResult();
final String base64 = encode(result);
//This is the WebView
results.loadData(base64, "text/html; charset=utf-8", "base64");
}
private String encode(final String value){
try{
final byte[] bytes = value.getBytes("UTF-8");
final String base64 = Base64.encodeToString(bytes,
android.util.Base64.DEFAULT);
return base64;
}
catch(UnsupportedEncodingException e){
return "YOULOOZE";
}
}
您的日志猫的任何错误? – RobinHood
没有意义的错误,没有 – miniBill
你终于解决了吗?大!并感谢赏金。也许你可以用解决方案更新你的问题 – Maragues