當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。