1
onReceivedError
을 사용하여 내 웹보기에서 모든 종류의 오류를 감지하지만 해당 웹 사이트가 자국에서 차단 된 경우 검색하고 싶습니다. (net::ERR_CONNECTION_REFUSED
오류). 어떻게해야합니까?webview에서 페이지 로딩 오류를 감지하는 방법은 무엇입니까?
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
view.loadUrl("about:blank");//hide the error page
Toast.makeText(getBaseContext(), "connection lost", Toast.LENGTH_SHORT).show();
findViewById(R.id.welcome).setVisibility(View.VISIBLE);
animEnabled = true;//enable welcome screen animation
super.onReceivedError(view, errorCode, description, failingUrl);
}