Java Code Examples for android.webkit.ConsoleMessage#lineNumber()
The following examples show how to use
android.webkit.ConsoleMessage#lineNumber() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FolioPageFragment.java From ankihelper with GNU General Public License v3.0 | 5 votes |
@Override public boolean onConsoleMessage(final ConsoleMessage cm) { super.onConsoleMessage(cm); String msg = cm.message() + ", From line " + cm.lineNumber() + " of " + cm.sourceId(); return FolioWebView.onWebViewConsoleMessage(cm, "WebViewConsole", msg); }
Example 2
Source File: CustomWebChromeClient.java From ForPDA with GNU General Public License v3.0 | 5 votes |
@Override public boolean onConsoleMessage(ConsoleMessage consoleMessage) { String message = ""; message += "\"" + consoleMessage.message() + "\""; String source = consoleMessage.sourceId(); if (source != null) { int cut = source.lastIndexOf('/'); if (cut != -1) { source = source.substring(cut + 1); } message += ", [" + source + "]"; } message += ", (" + consoleMessage.lineNumber() + ")"; ConsoleMessage.MessageLevel level = consoleMessage.messageLevel(); if (level == ConsoleMessage.MessageLevel.DEBUG) { Log.d(CONSOLE_TAG, message); } else if (level == ConsoleMessage.MessageLevel.ERROR) { Log.e(CONSOLE_TAG, message); } else if (level == ConsoleMessage.MessageLevel.WARNING) { Log.w(CONSOLE_TAG, message); } else if (level == ConsoleMessage.MessageLevel.LOG || level == ConsoleMessage.MessageLevel.TIP) { Log.i(CONSOLE_TAG, message); } else { Log.d(CONSOLE_TAG, message); } return true; }