Android webView 中调试javaScripte

来源:互联网 发布:mac关闭盖子不断网 编辑:程序博客网 时间:2024/06/04 18:00
mywebview.setWebChromeClient(new WebChromeClient() {
     public void onConsoleMessage(String message, int lineNumber, String sourceID) {
       Log.d("MyApplication", message + " -- From line "
                            + lineNumber + " of "
                            + sourceID);
     }
   });
 
这样以后,就可以在DDMS里的logcat输出js里面的console了
 
 js里面随便哪里console.log(“lalala”);就可以了
 
原创粉丝点击