I have this simple HTML that I load into an Android WebView (SDK version 1.5)-
<html>
<body onload="nomethod()">
<h1>Hello World</h1>
开发者_如何转开发</body>
</html>
Function nomethod() doesn't exist but the LogCat doesn't display any error.
It seems that any exception that isn't caught cannot be traced. Any idea how can I handle or trace uncaught exceptions?Thanks!
You might be able to get that if you register a WebChromeClient
with your WebView
. In particular, look at onConsoleMessage()
.
They aren't displayed unless you've registered a client. Since you're unable to use it, you and your users will never see JSExceptions.
精彩评论