本文整理匯總了Java中android.webkit.ConsoleMessage.message方法的典型用法代碼示例。如果您正苦於以下問題:Java ConsoleMessage.message方法的具體用法?Java ConsoleMessage.message怎麽用?Java ConsoleMessage.message使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.webkit.ConsoleMessage
的用法示例。
在下文中一共展示了ConsoleMessage.message方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String msg = consoleMessage.message();
if (msg == null)
return false;
Uri uri = Uri.parse(msg);
if (uri != null && null != uri.getScheme() && uri.getScheme().equals(SMALL_SCHEME))
{
String host = uri.getHost();
String ret = uri.getQueryParameter(SMALL_QUERY_KEY_RET);
if (host.equals(SMALL_HOST_POP)) {
WebActivity activity = mWebView.getActivity();
if (activity != null) {
activity.finish(ret);
}
} else if (host.equals(SMALL_HOST_EXEC)) {
if (mWebView.mOnResultListener != null) {
mWebView.mOnResultListener.onResult(ret);
}
}
return true;
}
Log.d(consoleMessage.sourceId(),
"line" + consoleMessage.lineNumber() + ": " + consoleMessage.message());
return true;
}
示例2: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
public boolean onConsoleMessage(ConsoleMessage consolemessage)
{
Log.i("WebConsole", (new StringBuilder()).append(consolemessage.message()).append(" -- From 111 line ").append(consolemessage.lineNumber()).append(" of ").append(consolemessage.sourceId()).toString());
if (android.os.Build.VERSION.SDK_INT > 7)
{
d d1 = a;
String s;
if (consolemessage == null)
{
s = "";
} else
{
s = consolemessage.message();
}
d1.onConsoleMessage(s);
}
return true;
}
示例3: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
/**
* @see AwContentsClient#onConsoleMessage(android.webkit.ConsoleMessage)
*/
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
TraceEvent.begin();
boolean result;
if (mWebChromeClient != null) {
if (TRACE) Log.d(TAG, "onConsoleMessage");
result = mWebChromeClient.onConsoleMessage(consoleMessage);
String message = consoleMessage.message();
if (result && message != null && message.startsWith("[blocked]")) {
Log.e(TAG, "Blocked URL: " + message);
}
} else {
result = false;
}
TraceEvent.end();
return result;
}
示例4: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
public boolean onConsoleMessage(final ConsoleMessage cm) {
final MessageLevel level = cm.messageLevel();
final String msg = cm.message() + " -- From line " + cm.lineNumber()
+ " of " + cm.sourceId();
if (level.compareTo(MessageLevel.DEBUG) == 0) {
Log.d(Constants.LOG_TAG, msg);
} else if (level.compareTo(MessageLevel.ERROR) == 0) {
Log.e(Constants.LOG_TAG, msg);
} else if (level.compareTo(MessageLevel.WARNING) == 0) {
Log.w(Constants.LOG_TAG, msg);
} else {
Log.d(Constants.LOG_TAG, msg);
}
return true;
}
示例5: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
@TargetApi(8)
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage)
{
if (consoleMessage.message() != null)
LOG.d(LOG_TAG, "%s: Line %d : %s" , consoleMessage.sourceId() , consoleMessage.lineNumber(), consoleMessage.message());
return super.onConsoleMessage(consoleMessage);
}
示例6: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
public final boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String message = consoleMessage.message();
if (TextUtils.isEmpty(message)) {
return super.onConsoleMessage(consoleMessage);
}
Object obj = null;
if (message.startsWith("h5container.message: ")) {
obj = message.replaceFirst("h5container.message: ", "");
}
if (TextUtils.isEmpty(obj)) {
return super.onConsoleMessage(consoleMessage);
}
AuthActivity.b(this.a, obj);
return super.onConsoleMessage(consoleMessage);
}
示例7: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
@TargetApi(8)
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage)
{
if (consoleMessage.message() != null)
LOG.d(TAG, "%s: Line %d : %s" , consoleMessage.sourceId() , consoleMessage.lineNumber(), consoleMessage.message());
return super.onConsoleMessage(consoleMessage);
}
示例8: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
@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;
}
示例9: onConsoleMessage
import android.webkit.ConsoleMessage; //導入方法依賴的package包/類
@TargetApi(8)
public boolean onConsoleMessage(ConsoleMessage paramConsoleMessage)
{
if (paramConsoleMessage.message() != null)
LOG.d(this.TAG, paramConsoleMessage.message());
return super.onConsoleMessage(paramConsoleMessage);
}