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


Java WebResourceError类代码示例

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


WebResourceError类属于android.webkit包,在下文中一共展示了WebResourceError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError webResourceError) {
    String errMsg = "WebViewError:";


    if (webResourceError != null) {
        if (webResourceError.getErrorCode() == -2) {
            //view.loadData("<div></div>", "text/html", "UTF-8");
        }
        errMsg += webResourceError.getErrorCode() + "-" ;
        errMsg += webResourceError.getDescription() + "-";
        if (request != null && request.getUrl() != null) {
            errMsg += request.getUrl().toString();
        }

    }
    if (errMsg.contains("favicon.ico")) {
        return;
    }
    controlsViewClient.handleKControlsError(new KPError(errMsg));
}
 
开发者ID:kaltura,项目名称:player-sdk-native-android,代码行数:23,代码来源:KControlsView.java

示例2: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
  super.onReceivedError(view, request, error);
  Crashlytics.log(5, "KolibriWebView",
      "onReceivedError() called with: request = [" + request + "], error = [" + error + "]");

  // We ignore errors regarding assets loading,
  // so in this case we check if the request url and webview url are same
  if (request.getUrl().toString().equals(view.getUrl()) || request.isForMainFrame()) {
    for (KolibriWebViewClient webClient : webClients) {
      webClient.onReceivedError(view, request, error);
    }
  }
}
 
开发者ID:azmedien,项目名称:kolibri-android,代码行数:16,代码来源:KolibriWebView.java

示例3: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {

  super.onReceivedError(view, request, error);
  String errorHtml = "<html><body><h2>找不到网页</h2></body></html>";
  view.loadDataWithBaseURL(null, errorHtml, "text/html", "UTF-8", null);
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:8,代码来源:BrowserActivity.java

示例4: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
    public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {

        if (AgentWebUtils.isOverriedMethod(mWebViewClient, "onReceivedError", WEBVIEWCLIENTPATH + ".onReceivedError", WebView.class, WebResourceRequest.class, WebResourceError.class)) {
            super.onReceivedError(view, request, error);
//            return;
        }
        if (request.isForMainFrame()) {
            onMainFrameError(view,
                    error.getErrorCode(), error.getDescription().toString(),
                    request.getUrl().toString());
        }
        LogUtils.i(TAG, "onReceivedError:" + error.toString());
    }
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:15,代码来源:DefaultWebClient.java

示例5: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {

        if(mWebViewClient!=null){
            mWebViewClient.onReceivedError(view,request,error);
            return;
        }

        super.onReceivedError(view,request,error);
    }
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:10,代码来源:WrapperWebViewClient.java

示例6: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
/**
 * Fires in cases where the webview cannot even load (e.g. no network)
 */
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    onReceivedError(view,
            error.getErrorCode(),
            error.getDescription().toString(),
            request.getUrl().toString());
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:12,代码来源:TubiVPAID.java

示例7: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    LogUtils.d("savor:webview "+error.getDescription());
    isLoadError = true;
    if (updateProgressListener!=null){
        updateProgressListener.loadHttpError();
    }
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:9,代码来源:CustomWebView.java

示例8: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    isLoadError = true;
    if (updateProgressListener!=null){
        updateProgressListener.loadHttpError();
    }
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:9,代码来源:DefaultWebView.java

示例9: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (mCustomWebViewClient!=null){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            mCustomWebViewClient.onReceivedError(view, request, error);
        }
        return;
    }
    super.onReceivedError(view, request, error);
}
 
开发者ID:yale8848,项目名称:CacheWebView,代码行数:11,代码来源:CacheWebViewClient.java

示例10: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);

    // Log the error message for debugging
    Log.d(getClass().getSimpleName(), error.toString());

    // Display toast message describing error details
    String errorDetails = String.valueOf(error.getDescription());
    Toast.makeText(mContext, errorDetails, Toast.LENGTH_LONG).show();
}
 
开发者ID:dipu-bd,项目名称:mangafox,代码行数:12,代码来源:MainActivity.java

示例11: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@TargetApi(android.os.Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    // Redirect to deprecated method, so you can use it in all SDK versions
    onReceivedError(view, error.getErrorCode(), error.getDescription().toString(), request.getUrl().toString());

}
 
开发者ID:kwmt,项目名称:GitHubSearch,代码行数:8,代码来源:GitHubSearchWebViewClient.java

示例12: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request,
                            WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (mTvPlayActivity.get() != null) {
        mTvPlayActivity.get().sendParseDataMessage(LOAD_DATA_ERROR);
    }
}
 
开发者ID:henryblue,项目名称:TeaCup,代码行数:9,代码来源:MoviePlayActivity.java

示例13: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    mEmptyLayout.setErrorType(EmptyLayout.NODATA);
    if (callback != null) {
        callback.onReceivedError(view, request, error);
    }
}
 
开发者ID:kymjs,项目名称:CoreModule,代码行数:9,代码来源:BrowserFragment.java

示例14: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(final WebView view, WebResourceRequest request,
                            WebResourceError error) {
    super.onReceivedError(view, request, error);
    final EmptyLayout emptyLayout = viewDelegate.get(R.id.emptylayout);
    emptyLayout.setOnLayoutClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            view.loadUrl(view.getUrl());
            emptyLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
        }
    });
    emptyLayout.setErrorType(EmptyLayout.NETWORK_ERROR);
}
 
开发者ID:kymjs,项目名称:CoreModule,代码行数:15,代码来源:BrowserDelegateOption.java

示例15: onReceivedError

import android.webkit.WebResourceError; //导入依赖的package包/类
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {

    super.onReceivedError(view, request, error);
    UIUtil.showToast(WebPageActivity.this, error.toString());
    mProgressBar.setVisibility(View.GONE);
}
 
开发者ID:huyongli,项目名称:TigerVideo,代码行数:8,代码来源:WebPageActivity.java


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