Code example for ConsoleMessage

Methods: lineNumbermessagesourceId

0
 
        WebView myWebView = (WebView) findViewById(R.id.webview);
 
        myWebView.setWebChromeClient(new WebChromeClient() {
            public boolean onConsoleMessage(ConsoleMessage cm) {
                Log.d("Intellihouse", cm.message() + " -- From line "
                        + cm.lineNumber() + " of "
                        + cm.sourceId());
                return true; 
            } 
        }); 
 
        //myWebView.addJavascriptInterface(new WebAppInterface(this), "Android"); 
 
        WebSettings webSettings = myWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
 
        //myWebView.loadUrl("http://172.31.200.9/androidapp/index.html"); 
        myWebView.loadUrl(INTELLI_URL);
    }