My app is a combination of Android native, html5. Till last week I'm able to see the log messages from native code and javascript code running inside th WebView. But suddenly Logcat is not showing the console messages from javascript, though it is showing Log messages from my native code. Any ideas?
Thanks in advance. Venkat
You can try adding a console message handler to your WebView by creating your custom WebChromeClient:
class MyWebChromeClient extends WebChromeClient
{
@Override
public boolean onConsoleMessage(ConsoleMessage cm)
{
Log.d("CONTENT", String.format("%s @ %d: %s",
cm.message(), cm.lineNumber(), cm.sourceId()));
return true;
}
}
And then attach it:
someWebView.setWebChromeClient(new MyWebChromeClient());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With