当前位置: 首页>>代码示例>>Java>>正文


Java ConsoleMessage.message方法代码示例

本文整理汇总了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;
}
 
开发者ID:ChanJLee,项目名称:SmallPatch,代码行数:27,代码来源:WebView.java

示例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;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:19,代码来源:H.java

示例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;
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:21,代码来源:WebViewContentsClientAdapter.java

示例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;
}
 
开发者ID:drdrej,项目名称:android-webview-example,代码行数:19,代码来源:WebChromeClient.java

示例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);
}
 
开发者ID:Andy-Ta,项目名称:COB,代码行数:9,代码来源:SystemWebChromeClient.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:16,代码来源:AuthActivity.java

示例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);
}
 
开发者ID:aabognah,项目名称:LoRaWAN-Smart-Parking,代码行数:9,代码来源:CordovaChromeClient.java

示例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;
}
 
开发者ID:RadiationX,项目名称:ForPDA,代码行数:31,代码来源:CustomWebChromeClient.java

示例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);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:8,代码来源:CordovaChromeClient.java


注:本文中的android.webkit.ConsoleMessage.message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。