Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

net::ERR_HTTP_RESPONSE_CODE_FAILURE on loading url android webview

I am using android webview to load a website and got the following error

net::ERR_HTTP_RESPONSE_CODE_FAILURE

I just want to know why i am getting this error. I don't find any helpful reference related to this error.

Thanks,

like image 309
Mohammad Faisal Avatar asked Aug 14 '26 10:08

Mohammad Faisal


1 Answers

 @Override
        public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request){
            Log.d("WebViewActivity", request.getUrl().toString());
            if( request.getUrl().toString().startsWith("http:") || request.getUrl().toString().startsWith("https:") ) {



            }
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(request.getUrl().toString()));
            startActivity( intent );
            return true;
        }

if in the shouldOverrideUrlLoading method do not do

view.loadUrl (String.valueOf (request.getUrl ()));
return false; 

the error disappears

like image 152
Crimiss Avatar answered Aug 15 '26 22:08

Crimiss