当前位置: 首页>>代码示例>>Java>>正文


Java WebViewClient类代码示例

本文整理汇总了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);
}
 
开发者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


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