【问题标题】:android webViewClient onReceivedError() always getting called even when there is no errorandroid webViewClient onReceivedError() 总是被调用,即使没有错误
【发布时间】:2013-02-27 12:23:42
【问题描述】:

我在WebView 中加载一个url,但是即使页面加载成功,WebViewClient 方法OnReceivedError() 也总是被调用。有人知道为什么会这样吗?

【问题讨论】:

  • 请发布您的代码
  • onReceivedError 为您提供errorCode - 它是什么?

标签: android webview webviewclient


【解决方案1】:

应该尝试在 WebViewClient 中监控 onReceivedError() 方法

如果页面在 webview 中加载正常,则调用 onReceivedError() 的原因是 HTML/JS 脚本中的警告,您可以忽略它,或者通过监视错误来修复。

【讨论】:

  • @Rawkode: 错误描述说连接到服务器 wq 不成功。
  • 那我怎么知道我是否必须忽略这个错误或者这是一个严重的错误,因为每次它说'连接到服务器不成功'。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-08-09
相关资源
最近更新 更多