android.webkit.WebResourceError源码实例Demo

类android.webkit.WebResourceError源码实例Demo

下面列出了android.webkit.WebResourceError 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: unity-ads-android   文件: WebPlayerView.java
@TargetApi(25)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
	if (shouldCallSuper("onReceivedError")) {
		super.onReceivedError(view, request, error);
	}
	if (shouldSendEvent("onReceivedError")) {
		String description = "";
		if (error != null && error.getDescription() != null) {
			description = error.getDescription().toString();
		}
		String url = "";
		if (request != null && request.getUrl() != null) {
			url = request.getUrl().toString();
		}
		WebPlayerEventBridge.error(viewId, url, description);
	}
}
 
源代码2 项目: AndroidWallet   文件: BaseWebView.java
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (request.isForMainFrame()) {
        mIsError = true;
    }
    if (mClient == null) {
        return;
    }
    mClient.onReceivedError(view, request, error);
}
 
源代码3 项目: YCAudioPlayer   文件: WebViewActivity.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    LogUtils.e("WebViewActivity-----onReceivedError-------" + error.toString());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        LogUtils.e("服务器异常" + error.getDescription().toString());
    }
    ToastUtils.showRoundRectToast("服务器异常6.0之后");
    //当加载错误时,就让它加载本地错误网页文件
    //mWebView.loadUrl("file:///android_asset/errorpage/error.html");

    showErrorPage();//显示错误页面
}
 
源代码4 项目: FastWebView   文件: InnerFastClient.java
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (mDelegate != null) {
        mDelegate.onReceivedError(view, request, error);
        return;
    }
    super.onReceivedError(view, request, error);
}
 
源代码5 项目: VideoOS-Android-SDK   文件: VenvyWebView.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (mIwebViewClient != null) {
        mIwebViewClient.onReceivedError(view, request, error);
    } else {
        super.onReceivedError(view, request, error);
    }
}
 
源代码6 项目: GDPR-Admob-Android   文件: ConsentForm.java
@Override
public void onReceivedError(
    WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    loadState = LoadState.NOT_READY;
    listener.onConsentFormError(error.toString());
}
 
源代码7 项目: AndroidProject   文件: BrowserView.java
/**
 * 同名 API 兼容
 */
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (request.isForMainFrame()) {
        onReceivedError(view,
                error.getErrorCode(), error.getDescription().toString(),
                request.getUrl().toString());
    }
}
 
@Override
public void onReceivedError(
    WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    loadState = LoadState.NOT_READY;
    listener.onConsentFormError(error.toString());
}
 
源代码9 项目: alpha-wallet-android   文件: Web3View.java
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    loadingError = true;
    if (externalClient != null)
        externalClient.onReceivedError(view, request, error);
}
 
源代码10 项目: HaoReader   文件: AjaxWebView.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        handler.obtainMessage(AjaxHandler.MSG_ERROR, new Exception(error.getDescription().toString()))
                .sendToTarget();
    }
}
 
源代码11 项目: HaoReader   文件: AjaxWebView.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        handler.obtainMessage(AjaxHandler.MSG_ERROR, new Exception(error.getDescription().toString()))
                .sendToTarget();
    }
}
 
源代码12 项目: AgentWeb   文件: DefaultWebClient.java
@TargetApi(Build.VERSION_CODES.M)
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
	if (request.isForMainFrame()) {
		onMainFrameError(view,
				error.getErrorCode(), error.getDescription().toString(),
				request.getUrl().toString());
	}
	LogUtils.i(TAG, "onReceivedError:" + error.getDescription() + " code:" + error.getErrorCode());
}
 
源代码13 项目: AgentWeb   文件: WebViewClientDelegate.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (mDelegate != null) {
        mDelegate.onReceivedError(view, request, error);
        return;
    }
    super.onReceivedError(view, request, error);
}
 
源代码14 项目: TubiPlayer   文件: TubiVPAID.java
/**
 * 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());
}
 
源代码15 项目: ClassSchedule   文件: Html5Activity.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    //6.0以上执行
    Log.i(TAG, "onReceivedError: ");
    showErrorPage();//显示错误页面
}
 
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (request.getUrl().toString().equals(mUrl)) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            LogUtil.e("WebError: " + error.getErrorCode());
        }
        mWebView.stopLoading();
        setSuccess(false);
        if (!isFailed) {
            setFailed(true);
            mListener.onFail();
        }
    }
}
 
源代码17 项目: CoreModule   文件: BrowserFragment.java
@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);
    }
}
 
源代码18 项目: CoreModule   文件: BrowserDelegateOption.java
@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);
}
 
源代码19 项目: TigerVideo   文件: WebPageActivity.java
@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);
}
 
源代码20 项目: SprintNBA   文件: HuPuWebView.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (callBack != null) {
        callBack.onError();
    }
}
 
源代码21 项目: unity-ads-android   文件: WebViewApp.java
@Override
public void onReceivedError(android.webkit.WebView view, WebResourceRequest request, WebResourceError error) {
	super.onReceivedError(view, request, error);
	if (view != null) {
		DeviceLog.error("WEBVIEW_ERROR: " + view.toString());
	}
	if (request != null) {
		DeviceLog.error("WEBVIEW_ERROR: " + request.toString());
	}
	if (error != null) {
		DeviceLog.error("WEBVIEW_ERROR: " + error.toString());
	}
}
 
源代码22 项目: JsBridge   文件: BridgeWebViewClient.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    boolean interrupt = false;
    if (bridgeWebViewClientListener != null) {
        interrupt = bridgeWebViewClientListener.onReceivedError(view, request, error);
    }
    if (!interrupt) {
        super.onReceivedError(view, request, error);
    }
}
 
源代码23 项目: ByWebView   文件: ByWebViewClient.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (request.isForMainFrame()) {//是否是为 main frame创建
            String mErrorUrl = "file:///android_asset/404_error.html";
            view.loadUrl(mErrorUrl);
        }
    }
}
 
源代码24 项目: ByWebView   文件: MyWebViewClient.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (request.isForMainFrame()) {//是否是为 main frame创建
            String mErrorUrl = "file:///android_asset/404_error.html";
            view.loadUrl(mErrorUrl);
        }
    }
}
 
源代码25 项目: chat-window-android   文件: ChatWindowView.java
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(final WebView view, final WebResourceRequest request, final WebResourceError error) {
    final boolean errorHandled = chatWindowListener != null && chatWindowListener.onError(ChatWindowErrorType.WebViewClient, error.getErrorCode(), String.valueOf(error.getDescription()));
    post(new Runnable() {
        @Override
        public void run() {
            onErrorDetected(errorHandled, ChatWindowErrorType.WebViewClient, error.getErrorCode(), String.valueOf(error.getDescription()));
        }
    });

    super.onReceivedError(view, request, error);
    Log.e("ChatWindow Widget", "onReceivedError: " + error.getErrorCode() + ": desc: " + error.getDescription() + " url: " + request.getUrl());
}
 
源代码26 项目: ZbarCode   文件: ResultsActivity.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (_dialog != null) {
        _dialog.dismiss();
        _dialog=null;
    }
    mTxtTitle.setVisibility(View.GONE);
    mTxtContent.setVisibility(View.VISIBLE);
    mTxtContent.setText("链接有问题");
}
 
源代码27 项目: rides-android-sdk   文件: RideRequestView.java
@TargetApi(23)
@Override
public void onReceivedError(WebView view,
        WebResourceRequest request,
        WebResourceError error) {
    receivedError();
}
 
源代码28 项目: TLint   文件: HuPuWebView.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (callBack != null) {
        callBack.onError();
    }
}
 
源代码29 项目: TemplateAppProject   文件: AgentWebFragment.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
}
 
源代码30 项目: TemplateAppProject   文件: XPageWebViewFragment.java
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
}