Returning value from Javascript *reliably* to Webview
问题 There is a way to call javascript function from webview and then let it call a method in Java to return the result. Like described in How to get return value from javascript in webview of android? Now, the javascript function can fail (say due to a typo in javascript file). In that case, I would like to carry out some failover code in Java. What is a good way to do that? My current code looks like this: In Java: private boolean eventHandled = false; @Override public void onEvent() {