本文整理了Java中com.tencent.smtt.sdk.WebView.loadUrl()
方法的一些代码示例,展示了WebView.loadUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.loadUrl()
方法的具体详情如下:
包路径:com.tencent.smtt.sdk.WebView
类名称:WebView
方法名:loadUrl
暂无
代码示例来源:origin: lionoggo/Akit-Reader
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
代码示例来源:origin: lionoggo/FastApp
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
代码示例来源:origin: gaolhjy/enjoyshop
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String s) {
webView.loadUrl(s);
return true;
}
代码示例来源:origin: linxin6560/DetailScrollView
/**
* 防止加载网页时调起系统浏览器
*/
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
};
代码示例来源:origin: lshAndroid/WebviewTBS
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
代码示例来源:origin: leftcoding/GankLy
/**
* 防止加载网页时调起系统浏览器
*/
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
};
代码示例来源:origin: dom4j1/Red
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
代码示例来源:origin: xkzh/yduoduo
/**
* 防止加载网页时调起系统浏览器
*/
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
};
代码示例来源:origin: Justson/AgentWebX5
private void loadJs(String js) {
mWebView.loadUrl(js);
}
private void evaluateJs(String js, final ValueCallback<String>callback){
代码示例来源:origin: linxin6560/DetailScrollView
public boolean shouldOverrideUrlLoading(com.tencent.smtt.sdk.WebView view, String url) { // 重写此方法表明点击网页里面的链接还是在当前的webview里跳转,不跳到浏览器那边
view.loadUrl(url);
return true;
}
});
代码示例来源:origin: luili16/UIMocker
/**
* 防止加载网页时调起系统浏览器
*/
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
};
代码示例来源:origin: dom4j1/Red
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
代码示例来源:origin: leftcoding/GankLy
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (!TextUtils.isEmpty(url)) {
mWebView.loadUrl(url);
}
return true;
}
代码示例来源:origin: leftcoding/GankLy
@Override
public void onNext(String s) {
if (TextUtils.isEmpty(s)) {
mWebView.loadUrl(mUrl);
} else {
mWebView.loadDataWithBaseURL(getLoadDataBaseUrl(), s, "text/html", "utf-8", mUrl);
}
}
});
代码示例来源:origin: gaolhjy/enjoyshop
@Override
public void run() {
mWebView.loadUrl("javascript:showDetail(" + goodsBean.getId() + ")");
}
});
代码示例来源:origin: leftcoding/GankLy
private void injectCSS(String filename) {
try {
InputStream inputStream = this.getAssets().open(filename);
byte[] buffer = new byte[inputStream.available()];
inputStream.read(buffer);
inputStream.close();
String encoded = Base64.encodeToString(buffer, Base64.NO_WRAP);
mWebView.loadUrl("javascript:(function() {" +
"var parent = document.getElementsByTagName('head').item(0);" +
"var style = document.createElement('style');" +
"style.type = 'text/css';" +
// Tell the browser to BASE64-decode the string into your script !!!
"style.innerHTML = window.atob('" + encoded + "');" +
"parent.appendChild(style)" +
"})()");
} catch (Exception e) {
e.printStackTrace();
}
}
代码示例来源:origin: Justson/AgentWebX5
@Override
public void loadUrl(String url) {
if (!AgentWebX5Utils.isUIThread()) {
safeLoadUrl(url);
return;
}
//|| ((!url.startsWith("http")&&(!url.startsWith("javascript:"))))
/*if (TextUtils.isEmpty(url))
throw new UrlCommonException("url is null or '' or not startsWith http ,javascript , file , please check url format");*/
if (!AgentWebX5Utils.isEmptyMap(this.headers))
this.mWebView.loadUrl(url, headers);
else
this.mWebView.loadUrl(url);
}
代码示例来源:origin: CN-ZPH/Three360panorama
@SuppressLint("SetJavaScriptEnabled")
private void initView() {
tencent_webview = (WebView) findViewById(R.id.web);
tencent_webview.loadUrl(url);
WebSettings webSettings = tencent_webview.getSettings();
webSettings.setJavaScriptEnabled(true);
tencent_webview.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return true;
}
});
}
}
代码示例来源:origin: Justson/AgentWebX5
public static final void clearWebView(WebView m) {
if (m == null)
return;
if (Looper.myLooper() != Looper.getMainLooper())
return;
m.loadUrl("about:blank");
m.stopLoading();
if (m.getHandler() != null)
m.getHandler().removeCallbacksAndMessages(null);
m.removeAllViews();
/*ViewGroup mViewGroup = null;
if ((mViewGroup = ((ViewGroup) m.getParent())) != null)
mViewGroup.removeView(m);*/
m.setWebChromeClient(null);
m.setWebViewClient(null);
m.setTag(null);
m.clearHistory();
m.destroy();
m = null;
}
代码示例来源:origin: gaolhjy/enjoyshop
private void initData() {
final WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBlockNetworkImage(false);
webSettings.setAppCacheEnabled(true);
mWebView.loadUrl(HttpContants.WARES_DETAIL);
mAppInterfce = new WebAppInterface(this);
mWebView.addJavascriptInterface(mAppInterfce, "appInterface");
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String s) {
webView.loadUrl(s);
return true;
}
@Override
public void onPageFinished(WebView webView, String s) {
super.onPageFinished(webView, s);
//整个页面加载完后,才能调用这个方法
mAppInterfce.showDetail();
}
});
}
内容来源于网络,如有侵权,请联系作者删除!