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


Java XWalkJavascriptResult.confirmWithResult方法代码示例

本文整理汇总了Java中org.xwalk.core.XWalkJavascriptResult.confirmWithResult方法的典型用法代码示例。如果您正苦于以下问题:Java XWalkJavascriptResult.confirmWithResult方法的具体用法?Java XWalkJavascriptResult.confirmWithResult怎么用?Java XWalkJavascriptResult.confirmWithResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.xwalk.core.XWalkJavascriptResult的用法示例。


在下文中一共展示了XWalkJavascriptResult.confirmWithResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onJsPrompt

import org.xwalk.core.XWalkJavascriptResult; //导入方法依赖的package包/类
/**
 * Tell the client to display a prompt dialog to the user.
 * If the client returns true, WebView will assume that the client will
 * handle the prompt dialog and call the appropriate JsPromptResult method.
 * <p/>
 * Since we are hacking prompts for our own purposes, we should not be using them for
 * this purpose, perhaps we should hack console.log to do this instead!
 */
public boolean onJsPrompt(XWalkView view, String origin, String message, String defaultValue,
                           final XWalkJavascriptResult result) {
    // Unlike the @JavascriptInterface bridge, this method is always called on the UI thread.
    String handledRet = parentEngine.bridge.promptOnJsPrompt(origin, message, defaultValue);
    if (handledRet != null) {
        result.confirmWithResult(handledRet);
    } else {
        dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
            @Override
            public void gotResult(boolean success, String value) {
                if (success) {
                    result.confirmWithResult(value);
                } else {
                    result.cancel();
                }
            }
        });

    }
    return true;
}
 
开发者ID:infil00p,项目名称:cordova-plugin-crosswalk-webview,代码行数:30,代码来源:XWalkCordovaUiClient.java

示例2: appCanJsParse

import org.xwalk.core.XWalkJavascriptResult; //导入方法依赖的package包/类
private void appCanJsParse(final XWalkJavascriptResult result, XWalkView view, String parseStr) {
    try {
        if (!(view instanceof EBrowserView)) {
            return;
        }
        EBrowserView browserView = (EBrowserView) view;
        final EUExManager uexManager = browserView.getEUExManager();
        if (uexManager != null) {
            result.confirmWithResult(uexManager.dispatch(parseStr));
        }
    } catch (Exception e) {
        if (BDebug.DEBUG) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:17,代码来源:CBrowserMainFrame.java


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