Code example for ConsoleMessage

Methods: lineNumbermessagesourceId

0
		mWebView.getSettings().setJavaScriptEnabled(true);
		mWebView.addJavascriptInterface(new JavaScriptInterface(this), "Android");
		mWebView.setWebChromeClient(new WebChromeClient() {
			@Override 
			public boolean onConsoleMessage(final ConsoleMessage cm) {
				Log.d("BINGMAPS", cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId());
				return true; 
			} 
		}); 
		mWebView.loadUrl("file:///android_asset/map.html");
    } 
 
	public class JavaScriptInterface { 
		Context mContext;
 
		/** Instantiate the interface and set the context */ 
		JavaScriptInterface(final Context context) {
			mContext = context;
		}