• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WebViewClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.tencent.smtt.sdk.WebViewClient的典型用法代码示例。如果您正苦于以下问题:Java WebViewClient类的具体用法?Java WebViewClient怎么用?Java WebViewClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WebViewClient类属于com.tencent.smtt.sdk包,在下文中一共展示了WebViewClient类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
 
开发者ID:runner525,项目名称:x5webview-cordova-plugin,代码行数:33,代码来源:X5WebViewClient.java


示例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);
}
 
开发者ID:zsxsoft,项目名称:cordova-plugin-x5-tbs,代码行数:33,代码来源:X5WebViewClient.java


示例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();
}
 
开发者ID:ydmmocoo,项目名称:StudyApp,代码行数:20,代码来源:NewDetailActivity.java


示例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;
        }
    });

}
 
开发者ID:arieshao,项目名称:Integration,代码行数:17,代码来源:DetailActivity.java


示例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;
        }

    }
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:33,代码来源:AgentWebX5.java


示例6: setClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
public Builder setClient(WebViewClient client) {
    this.client = client;
    return this;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:5,代码来源:DefaultWebClient.java


示例7: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
public CommonAgentBuilder setWebViewClient(@Nullable WebViewClient webViewClient) {
    this.mAgentBuilder.mWebViewClient = webViewClient;
    return this;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:5,代码来源:AgentWebX5.java


示例8: WrapperWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
WrapperWebViewClient (WebViewClient client){
    this.mWebViewClient=client;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:4,代码来源:WrapperWebViewClient.java


示例9: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
void setWebViewClient(WebViewClient webViewClient){
    this.mWebViewClient=webViewClient;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:4,代码来源:WrapperWebViewClient.java


示例10: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
public WebListenerManager setWebViewClient(WebView webView, WebViewClient webViewClient) {
    webView.setWebViewClient(webViewClient);
    return this;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:6,代码来源:WebDefaultSettingsManager.java


示例11: MiddleWareWebClientBase

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
MiddleWareWebClientBase(WebViewClient client) {
    super(client);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:4,代码来源:MiddleWareWebClientBase.java


示例12: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
 final void setWebViewClient(WebViewClient webViewClient) {
    super.setWebViewClient(webViewClient);

}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:6,代码来源:MiddleWareWebClientBase.java


示例13: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
public void setWebViewClient(WebViewClient client) {
    viewClient = (X5WebViewClient)client;
    super.setWebViewClient(client);
}
 
开发者ID:runner525,项目名称:x5webview-cordova-plugin,代码行数:6,代码来源:X5WebView.java


示例14: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
@Override
public void setWebViewClient(WebViewClient client) {
  viewClient = (X5WebViewClient) client;
  super.setWebViewClient(client);
}
 
开发者ID:zsxsoft,项目名称:cordova-plugin-x5-tbs,代码行数:6,代码来源:X5WebView.java


示例15: onCreateWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
protected WebViewClient onCreateWebViewClient(WJBridgeProvider provider){
    return new WJBridgeX5WebViewClient(provider);
}
 
开发者ID:amphiaraus,项目名称:WebViewJavascriptBridge,代码行数:4,代码来源:WJBridgeX5WebView.java


示例16: setWebViewClient

import com.tencent.smtt.sdk.WebViewClient; //导入依赖的package包/类
WebListenerManager setWebViewClient(WebView webView, WebViewClient webViewClient); 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:2,代码来源:WebListenerManager.java



注:本文中的com.tencent.smtt.sdk.WebViewClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractHandlerExceptionResolver类代码示例发布时间:2022-05-21
下一篇:
Java TList类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap