本文整理汇总了Java中com.tencent.smtt.export.external.interfaces.JsResult类的典型用法代码示例。如果您正苦于以下问题:Java JsResult类的具体用法?Java JsResult怎么用?Java JsResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsResult类属于com.tencent.smtt.export.external.interfaces包,在下文中一共展示了JsResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
if (!((EBrowserActivity) view.getContext()).isVisable()) {
result.confirm();
}
AlertDialog.Builder dia = new AlertDialog.Builder(view.getContext());
dia.setTitle(EUExUtil.getResStringID("prompt"));
dia.setMessage(message);
dia.setCancelable(false);
dia.setPositiveButton(EUExUtil.getResStringID("confirm"), new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
result.confirm();
}
});
dia.create();
dia.show();
return true;
}
示例2: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
if (AgentWebX5Utils.isOverriedMethod(mWebChromeClient, "onJsAlert", "public boolean " + ChromePath + ".onJsAlert", WebView.class, String.class, String.class, JsResult.class)) {
return super.onJsAlert(view, url, message, result);
}
Activity mActivity = this.mActivityWeakReference.get();
if (mActivity == null||mActivity.isFinishing()) {
result.cancel();
return true;
}
//
try {
AgentWebX5Utils.show(view,
message,
Snackbar.LENGTH_SHORT,
Color.WHITE,
mActivity.getResources().getColor(R.color.black),
null,
-1,
null);
} catch (Throwable throwable) {
throwable.printStackTrace();
if(LogUtils.isDebug())
LogUtils.i(TAG,throwable.getMessage());
}
result.confirm();
return true;
}
示例3: onJsConfirm
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
@Override
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
LogUtils.i(TAG, message);
if (AgentWebX5Utils.isOverriedMethod(mWebChromeClient, "onJsConfirm", "public boolean " + ChromePath + ".onJsConfirm", WebView.class, String.class, String.class, JsResult.class)) {
return super.onJsConfirm(view, url, message, result);
}
showJsConfirm(message, result);
return true; //
}
示例4: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
示例5: onJsConfirm
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
示例6: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
/**
* Tell the client to display a javascript alert dialog.
*/
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
示例7: onJsConfirm
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
/**
* Tell the client to display a confirm dialog to the user.
*/
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
示例8: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
示例9: onJsConfirm
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
示例10: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
public boolean onJsAlert(WebView view, String url, String message,
JsResult result) {
if (this.mRealWebChromeClient != null)
return this.mRealWebChromeClient.onJsAlert(view, url, message, result);
return super.onJsAlert(view,url,message,result);
}
示例11: onJsConfirm
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
public boolean onJsConfirm(WebView view, String url, String message,
JsResult result) {
if (this.mRealWebChromeClient != null)
return this.mRealWebChromeClient.onJsConfirm(view, url, message, result);
return super.onJsConfirm(view,url,message,result);
}
示例12: onJsBeforeUnload
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
public boolean onJsBeforeUnload(WebView view, String url, String message,
JsResult result) {
if (this.mRealWebChromeClient != null)
return this.mRealWebChromeClient.onJsBeforeUnload(view, url, message, result);
return super.onJsBeforeUnload(view,url,message,result);
}
示例13: toCancelJsresult
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
private void toCancelJsresult(JsResult result) {
if (result != null)
result.cancel();
}
示例14: onJsAlert
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
return false;
}
示例15: onJsConfirm
import com.tencent.smtt.export.external.interfaces.JsResult; //导入依赖的package包/类
@Override
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
return false;
}