3

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!

2 Answers 2

3

You might be able to get that if you register a WebChromeClient with your WebView. In particular, look at onConsoleMessage().

Sign up to request clarification or add additional context in comments.

1 Comment

That would explain why I didn't remember it... :-)
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.