本文整理汇总了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;
}
示例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();
}
}
}