本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
示例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;
}
示例8: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result);
示例9: onJsPrompt
import com.tencent.smtt.export.external.interfaces.JsPromptResult; //导入依赖的package包/类
boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result);