Code example for WebResourceResponse

0
 
      @Override 
      public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
        if (url.contains("intent/auth")) {
          //performAuth(url); 
          return new WebResourceResponse("text/plain", "utf-8", new ByteArrayInputStream(new byte[0]));
        } else { 
          return null; 
        } 
      } 
    }); 
  } 
 
  private void performAuth(final String url) {
    final Activity self = this;
    Runnable runnable = new Runnable() {
      public void run() { 
        try { 
          Uri uri = Uri.parse(url);
          Intent intent = new Intent("ws.kotonoha.AUTH", uri);
          self.setResult(0, intent);