android.webkit.WebResourceError Java Examples

The following examples show how to use android.webkit.WebResourceError. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebPlayerView.java    From unity-ads-android with Apache License 2.0 6 votes vote down vote up
@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);
	}
}
 
Example #2
Source File: WebViewApp.java    From unity-ads-android with Apache License 2.0 5 votes vote down vote up
@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());
	}
}
 
Example #3
Source File: Web3View.java    From alpha-wallet-android with MIT License 5 votes vote down vote up
@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);
}
 
Example #4
Source File: AjaxWebView.java    From HaoReader with GNU General Public License v3.0 5 votes vote down vote up
@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();
    }
}
 
Example #5
Source File: ConsentForm.java    From googleads-consent-sdk-android with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceivedError(
    WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    loadState = LoadState.NOT_READY;
    listener.onConsentFormError(error.toString());
}
 
Example #6
Source File: ConsentForm.java    From GDPR-Admob-Android with MIT License 5 votes vote down vote up
@Override
public void onReceivedError(
    WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    loadState = LoadState.NOT_READY;
    listener.onConsentFormError(error.toString());
}
 
Example #7
Source File: VenvyWebView.java    From VideoOS-Android-SDK with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (mIwebViewClient != null) {
        mIwebViewClient.onReceivedError(view, request, error);
    } else {
        super.onReceivedError(view, request, error);
    }
}
 
Example #8
Source File: AjaxWebView.java    From HaoReader with GNU General Public License v3.0 5 votes vote down vote up
@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();
    }
}
 
Example #9
Source File: WebViewActivity.java    From YCAudioPlayer with Apache License 2.0 5 votes vote down vote up
@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();//显示错误页面
}
 
Example #10
Source File: HuPuWebView.java    From TLint with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (callBack != null) {
        callBack.onError();
    }
}
 
Example #11
Source File: InnerFastClient.java    From FastWebView with MIT License 5 votes vote down vote up
@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);
}
 
Example #12
Source File: BrowserView.java    From AndroidProject with Apache License 2.0 5 votes vote down vote up
/**
 * 同名 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());
    }
}
 
Example #13
Source File: RideRequestView.java    From rides-android-sdk with MIT License 5 votes vote down vote up
@TargetApi(23)
@Override
public void onReceivedError(WebView view,
        WebResourceRequest request,
        WebResourceError error) {
    receivedError();
}
 
Example #14
Source File: WebViewClientDelegate.java    From AgentWeb with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    if (mDelegate != null) {
        mDelegate.onReceivedError(view, request, error);
        return;
    }
    super.onReceivedError(view, request, error);
}
 
Example #15
Source File: TubiVPAID.java    From TubiPlayer with MIT License 5 votes vote down vote up
/**
 * 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());
}
 
Example #16
Source File: ResultsActivity.java    From ZbarCode with Apache License 2.0 5 votes vote down vote up
@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("链接有问题");
}
 
Example #17
Source File: ChatWindowView.java    From chat-window-android with MIT License 5 votes vote down vote up
@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());
}
 
Example #18
Source File: Html5Activity.java    From ClassSchedule with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    //6.0以上执行
    Log.i(TAG, "onReceivedError: ");
    showErrorPage();//显示错误页面
}
 
Example #19
Source File: MyWebViewClient.java    From ByWebView with Apache License 2.0 5 votes vote down vote up
@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);
        }
    }
}
 
Example #20
Source File: AdvanceWebClient.java    From cloudflare-scrape-Android with MIT License 5 votes vote down vote up
@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();
        }
    }
}
 
Example #21
Source File: ByWebViewClient.java    From ByWebView with Apache License 2.0 5 votes vote down vote up
@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);
        }
    }
}
 
Example #22
Source File: BridgeWebViewClient.java    From JsBridge with MIT License 5 votes vote down vote up
@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);
    }
}
 
Example #23
Source File: BaseWebView.java    From AndroidWallet with GNU General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example #24
Source File: BrowserFragment.java    From CoreModule with Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example #25
Source File: BrowserDelegateOption.java    From CoreModule with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #26
Source File: WebPageActivity.java    From TigerVideo with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #27
Source File: HuPuWebView.java    From SprintNBA with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);
    if (callBack != null) {
        callBack.onError();
    }
}
 
Example #28
Source File: DefaultWebClient.java    From AgentWeb with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #29
Source File: SampleWebViewClient.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    super.onReceivedError(view, request, error);

    view.loadDataWithBaseURL("", showErrorString, "text/html", "utf-8", null);
}
 
Example #30
Source File: WebFragment.java    From yandex-money-sdk-android with MIT License 4 votes vote down vote up
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
    hideProgressBar();
    showError();
}