本文整理汇总了Java中com.tencent.smtt.sdk.WebViewClient类的典型用法代码示例。如果您正苦于以下问题:Java WebViewClient类的具体用法?Java WebViewClient怎么用?Java WebViewClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebViewClient类属于com.tencent.smtt.sdk包,在下文中一共展示了WebViewClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceivedError
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
/**
* Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
* The errorCode parameter corresponds to one of the ERROR_* constants.
*
* @param view The WebView that is initiating the callback.
* @param errorCode The error code corresponding to an ERROR_* value.
* @param description A String describing the error.
* @param failingUrl The url that failed to load.
*/
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
// Ignore error due to stopLoading().
if (!isCurrentlyLoading) {
return;
}
LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl);
// If this is a "Protocol Not Supported" error, then revert to the previous
// page. If there was no previous page, then punt. The application's config
// is likely incorrect (start page set to sms: or something like that)
if (errorCode == WebViewClient.ERROR_UNSUPPORTED_SCHEME) {
parentEngine.client.clearLoadTimeoutTimer();
if (view.canGoBack()) {
view.goBack();
return;
} else {
super.onReceivedError(view, errorCode, description, failingUrl);
}
}
parentEngine.client.onReceivedError(errorCode, description, failingUrl);
}
示例2: onReceivedError
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
/**
* Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
* The errorCode parameter corresponds to one of the ERROR_* constants.
*
* @param view The WebView that is initiating the callback.
* @param errorCode The error code corresponding to an ERROR_* value.
* @param description A String describing the error.
* @param failingUrl The url that failed to load.
*/
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
// Ignore error due to stopLoading().
if (!isCurrentlyLoading) {
return;
}
LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl);
// If this is a "Protocol Not Supported" error, then revert to the previous
// page. If there was no previous page, then punt. The application's config
// is likely incorrect (start page set to sms: or something like that)
if (errorCode == WebViewClient.ERROR_UNSUPPORTED_SCHEME) {
parentEngine.client.clearLoadTimeoutTimer();
if (view.canGoBack()) {
view.goBack();
return;
} else {
super.onReceivedError(view, errorCode, description, failingUrl);
}
}
parentEngine.client.onReceivedError(errorCode, description, failingUrl);
}
示例3: init
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
protected void init() {
String link=getIntent().getStringExtra("link");
tvTitle.setText(getIntent().getStringExtra("title"));
WebSettings webSettings = mWvNewsContent.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
mWvNewsContent.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
mWvNewsContent.loadUrl(link);
setListenr();
}
示例4: initWebConfig
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
private void initWebConfig() {
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setLoadWithOverviewMode(true);
settings.setAppCacheEnabled(true);
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
settings.setSupportZoom(true);
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
}
示例5: getClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
private WebViewClient getClient() {
LogUtils.i(TAG, "getWebViewClient:" + this.mMiddleWrareWebClientBaseHeader);
DefaultWebClient mDefaultWebClient = DefaultWebClient
.createBuilder()
.setActivity(this.mActivity)
.setClient(this.mWebViewClient)
.setManager(this.mWebViewClientCallbackManager)
.setWebClientHelper(this.webClientHelper)
.setPermissionInterceptor(this.mPermissionInterceptor)
.setWebView(this.mWebCreator.get())
.setInterceptUnkownScheme(this.isInterceptUnkownScheme)
.setSchemeHandleType(this.openOtherAppWays)
.setCfg(this.mDefaultMsgConfig.getWebViewClientMsgCfg())
.build();
MiddleWareWebClientBase header = this.mMiddleWrareWebClientBaseHeader;
if (header != null) {
MiddleWareWebClientBase tail = header;
int count = 1;
MiddleWareWebClientBase tmp = header;
while (tmp.next() != null) {
tail = tmp = tmp.next();
count++;
}
LogUtils.i(TAG, "MiddleWareWebClientBase middleware count:" + count);
tail.setWebViewClient(mDefaultWebClient);
return header;
} else {
return mDefaultWebClient;
}
}
示例6: setClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
public Builder setClient(WebViewClient client) {
this.client = client;
return this;
}
示例7: setWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
public CommonAgentBuilder setWebViewClient(@Nullable WebViewClient webViewClient) {
this.mAgentBuilder.mWebViewClient = webViewClient;
return this;
}
示例8: WrapperWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
WrapperWebViewClient (WebViewClient client){
this.mWebViewClient=client;
}
示例9: setWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
void setWebViewClient(WebViewClient webViewClient){
this.mWebViewClient=webViewClient;
}
示例10: setWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
public WebListenerManager setWebViewClient(WebView webView, WebViewClient webViewClient) {
webView.setWebViewClient(webViewClient);
return this;
}
示例11: MiddleWareWebClientBase
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
MiddleWareWebClientBase(WebViewClient client) {
super(client);
}
示例12: setWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
final void setWebViewClient(WebViewClient webViewClient) {
super.setWebViewClient(webViewClient);
}
示例13: setWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
public void setWebViewClient(WebViewClient client) {
viewClient = (X5WebViewClient)client;
super.setWebViewClient(client);
}
示例14: setWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
public void setWebViewClient(WebViewClient client) {
viewClient = (X5WebViewClient) client;
super.setWebViewClient(client);
}
示例15: onCreateWebViewClient
import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
protected WebViewClient onCreateWebViewClient(WJBridgeProvider provider){
return new WJBridgeX5WebViewClient(provider);
}