mWv = (WebView) vg2.getChildAt(0);

设置成utf8格式

mWv.getSettings().setDefaultTextEncodingName("utf-8");

加载数据

mWv.loadData(xmlData, "text/html; charset=UTF-8", null);

效果图

Android之WebView加载xml数据及防止中文乱码

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-05-27
  • 2021-09-28
  • 2021-07-11
  • 2021-06-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
相关资源
相似解决方案