【发布时间】:2017-10-10 10:44:09
【问题描述】:
我有一个网页,如果在 webview 中加载该网页,则该页面应在移动 web 浏览器中重新加载,而不是在 webview 中。 基本上我想将用户从 webview 发送到浏览器。 这可以使用 javascript 或 jquery 吗?
【问题讨论】:
标签: javascript jquery html webview
我有一个网页,如果在 webview 中加载该网页,则该页面应在移动 web 浏览器中重新加载,而不是在 webview 中。 基本上我想将用户从 webview 发送到浏览器。 这可以使用 javascript 或 jquery 吗?
【问题讨论】:
标签: javascript jquery html webview
这是 webview 中对话框或弹出窗口的示例:
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Title here");
WebView wv = new WebView(this);
wv.loadUrl("http:\\www.google.com");
wv.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
alert.setView(wv);
alert.setNegativeButton("Close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
alert.show();
【讨论】: