Q:

File not found exception on webview - when in real the file exists

I am trying to load a webpage in a webview, however I am getting the following exception: 
java.io. FileNotFoundException: https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,900,700italic
02-05 18:52:44.497 5263-6265/com. RM W/System.err:     at com.android.okhttp.internal.http. HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:206)
02-05 18:52:44.497 5263-6265/com. RM W/System.err:     at com.android.okhttp.internal.http. DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
02-05 18:52:44.497 5263-6265/com. RM W/System.err:     at com.android.okhttp.internal.http. HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
02-05 18:52:44.497 5263-6265/com. RM W/System.err:     at navigationfragments. FragmentWebView$1.shouldInterceptRequest(FragmentWebView.java:124)
02-05 18:52:44.497 5263-6265/com. RM W/System.err:     at android.webkit. WebViewClient.shouldInterceptRequest(WebViewClient.java:125)
02-05 18:52:44.498 5263-6265/com. RM W/System.err:     at com.android.webview.chromium. WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:297)
02-05 18:52:44.498 5263-6265/com. RM W/System.err:     at org.chromium.android_webview. AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:465)
02-05 18:52:44.498 5263-6265/com. CRM W/System.err:     at org.chromium.android_webview. AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:38)

But to my amazement, if I click on the link:
https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,900,700italic
I can actually load it up in my browser.  This happens with many opther files too, which can normally be accessed from the browser.  What do I miss here?  
Below is my Custom implementation: 
WebViewClient webViewClient = new WebViewClient() {

            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                startAnim();
                super.onPageStarted(view, url, favicon);
            }

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                if (webView.getProgress() == 100) {
                    stopAnim();
                }
            }

            @Override
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                NoNetworkDialog.showNetworkDialog(getActivity());

            }

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                if (! CheckConnection.isNetworkConnected(getActivity())) {
                    NoNetworkDialog.showNetworkDialog(getActivity());
                    return false;
                } else {
                    view.loadUrl(url);
                    return true;
                }

            }

            @Override
            public WebResourceResponse shouldInterceptRequest(WebView view, String url1) {

                //  if (! CheckConnection.isNetworkConnected(getActivity())) {
                //    NoNetworkDialog.showNetworkDialog(getActivity());
                //  } else {
                try {
                    URL url = new URL(url1);

                    HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();

                    CookieManager cookieManager = CookieManager.getInstance();
                    String cookie = cookieManager.getCookie(url.getHost());

                    urlConnection.setDoOutput(true);
                    urlConnection.setRequestProperty("Cookie", cookie);
                    urlConnection.setRequestProperty("***_USER_AGENT", "***_app");
                    urlConnection.setRequestMethod("GET");

                    InputStream in = new BufferedInputStream(urlConnection.getInputStream());

                    return new WebResourceResponse(urlConnection.getContentType(), "UTF-8", in);

                } catch (Exception e) {
                    e.printStackTrace();

                    return null;
                }
                //  }
                //  return null;
            }
        };

Here are the other URL's I get this on: 
https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js
https://www.google.com/jsapi
https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js

A:

Delete setDoOutput() and see if it works.  You're not doing a POST request and you do not need it. 
Reference link is here.