Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: problem with debugging javascript in webview

Tags:

I have some javascript running in WebView, and I want to receive console messages about errors in JS. In accordance with the instructions at http://developer.android.com/guide/webapps/debugging.html I overrided methods

WebChromeClient.onConsoleMessage(String message, int lineNumber, String sourceID)

and

WebChromeClient.onConsoleMessage(ConsoleMessage cm),

redirecting messages to logcat. In android 2.1 it works well, but in android 2.2 none of this methods are called.

What I am doing wrong?

Thanks.

like image 234
Ilya Izhovkin Avatar asked Feb 01 '11 07:02

Ilya Izhovkin


1 Answers

It seems that HTC disabled console.log on Android 2.2 devices. check out this post:

How to display console.log() output in PhoneGap app using Eclipse and HTC Desire HD?

like image 64
GeorgeW Avatar answered Nov 07 '22 16:11

GeorgeW