Code example for WebResourceResponse

    public WebResourceResponse shouldInterceptRequest(String url) {
        ByteArrayInputStream stream = new ByteArrayInputStream(url.getBytes());
        return new WebResourceResponse("text/plain", "UTF-8", stream);
    public boolean onOverrideUrlLoading(String url) {
        Log.d(TAG, "[Override URL] ****** "+ url);
        String[] urlArray;
        String splitter = "://";
        // Split url by only 2 in the event "://" occurs elsewhere (SHOULD be impossible because you string encoded right!?) 
        urlArray = url.split(splitter,2);
Stop searching for code, let great code find you!  Add Codota to your java IDE