Code example for ConsoleMessage

Methods: lineNumbermessagesourceId

0
	private void createEditor()  { 
		webView = new WebView(this);
		webView.setWebViewClient(new HappyGUIWebViewClient());
		webView.setWebChromeClient(new WebChromeClient() {
			public boolean onConsoleMessage(ConsoleMessage cm) {
				Log.d("Error in WebView!", cm.message() + " -- From line "
						+ cm.lineNumber() + " of "
						+ cm.sourceId() );
				return true; 
			} 
		}); 
		webView.getSettings().setJavaScriptEnabled(true);
		webView.loadUrl("file:///android_asset/html5/editor.html");
		androidJS = new JSObject(webView);
		webView.addJavascriptInterface(androidJS, "jsObject"); // Facilitates communication between Javascript and Java 
	} 
 
	protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
		super.onActivityResult(requestCode, resultCode, intent);