本文整理汇总了Java中com.tencent.smtt.export.external.interfaces.JsPromptResult类的典型用法代码示例。如果您正苦于以下问题:Java JsPromptResult类的具体用法?Java JsPromptResult怎么用?Java JsPromptResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsPromptResult类属于com.tencent.smtt.export.external.interfaces包,在下文中一共展示了JsPromptResult类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
@Override
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
try {
if (AgentWebX5Utils.isOverriedMethod(mWebChromeClient, "onJsPrompt", "public boolean " + ChromePath + ".onJsPrompt", WebView.class, String.class, String.class, String.class, JsPromptResult.class)) {
return super.onJsPrompt(view, url, message, defaultValue, result);
}
if (AgentWebX5Config.WEBVIEW_TYPE == AgentWebX5Config.WEBVIEW_AGENTWEB_SAFE_TYPE && mChromeClientCallbackManager != null && mChromeClientCallbackManager.getAgentWebCompatInterface() != null) {
LogUtils.i(TAG, "mChromeClientCallbackManager.getAgentWebCompatInterface():" + mChromeClientCallbackManager.getAgentWebCompatInterface());
if (mChromeClientCallbackManager.getAgentWebCompatInterface().onJsPrompt(view, url, message, defaultValue, result))
return true;
}
showJsPrompt(message, result, defaultValue);
} catch (Exception e) {
// e.printStackTrace();
}
return true;
}
开发者ID:Justson,项目名称:AgentWebX5,代码行数:23,代码来源:DefaultChromeClient.java
示例2: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的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.
*
* 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!
*/
@Override
public boolean onJsPrompt(WebView view, String origin, String message, String defaultValue, final JsPromptResult 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.confirm(handledRet);
} else {
dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm(value);
} else {
result.cancel();
}
}
});
}
return true;
}
开发者ID:runner525,项目名称:x5webview-cordova-plugin,代码行数:29,代码来源:X5WebChromeClient.java
示例3: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的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.
*
* 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(WebView view, String origin, String message, String defaultValue, final JsPromptResult 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.confirm(handledRet);
} else {
dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm(value);
} else {
result.cancel();
}
}
});
}
return true;
}
开发者ID:jeremyup,项目名称:cordova-plugin-x5-webview,代码行数:28,代码来源:X5WebChromeClient.java
示例4: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的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!
*/
@Override
public boolean onJsPrompt(WebView view, String origin, String message, String defaultValue, final JsPromptResult 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.confirm(handledRet);
} else {
dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm(value);
} else {
result.cancel();
}
}
});
}
return true;
}
开发者ID:zsxsoft,项目名称:cordova-plugin-x5-tbs,代码行数:29,代码来源:X5WebChromeClient.java
示例5: appCanJsParse
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
private void appCanJsParse(final JsPromptResult result, WebView view, String parseStr) {
try {
if (!(view instanceof EBrowserView)) {
return;
}
EBrowserView browserView = (EBrowserView) view;
final EUExManager uexManager = browserView.getEUExManager();
if (uexManager != null) {
result.confirm(uexManager.dispatch(parseStr));
}
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:15,代码来源:CBrowserMainFrame.java
示例6: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
public boolean onJsPrompt(WebView view, String url, String message,
String defaultValue, JsPromptResult result) {
if (this.mRealWebChromeClient != null)
return this.mRealWebChromeClient.onJsPrompt(view, url, message, defaultValue, result);
return super.onJsPrompt(view,url,message,defaultValue,result);
}
开发者ID:Justson,项目名称:AgentWebX5,代码行数:7,代码来源:WebChromeClientWrapper.java
示例7: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
@Override
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
return false;
}
开发者ID:hjhrq1991,项目名称:JsBridge,代码行数:5,代码来源:WebChromeClientListener.java
示例8: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result);
开发者ID:Justson,项目名称:AgentWebX5,代码行数:2,代码来源:ChromeClientCallbackManager.java
示例9: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result);
开发者ID:hjhrq1991,项目名称:JsBridge,代码行数:2,代码来源:OnWebChromeClientListener.java
注:本文中的com.tencent.smtt.export.external.interfaces.JsPromptResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论