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);
Contextual code suggestions in your IDE  Get Codota for Java