title: How to intercept a http request done from Angular in a cordova Android plugin?
body: <p>I need to get the http headers of the response of an http request done with Angular on a Cordova app. I would like to keep a reference, on native side, of the token I get in the header.</p>
  
  <p>I can only seem to find references to the method <a href="http://developer.android.com/intl/es/reference/android/webkit/WebViewClient.html#shouldInterceptRequest%28android.webkit.WebView,%20android.webkit.WebResourceRequest%29" rel="nofollow">shouldInterceptRequest</a> of the class WebviewClient. I need to pass a WebViewClient to the WebView. The problem is I can't get the WebView!</p>
  
  <p>I tried several ways to get the webview from the CordovaActivy, but anything works. For instance if I do the following the app crashes.</p>
  
  <pre><code>public class MyActivity extends CordovaActivity
  {
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          // Set by &lt;content src="index.html" /&gt; in config.xml
          loadUrl(launchUrl);
          WebView v = (WebView) this.appView.getView();
          v.setWebViewClient(new WebViewClient() {
              @Override
              public WebResourceResponse shouldInterceptRequest(final WebView view, WebResourceRequest request) {
  
                  return super.shouldInterceptRequest(view, request);
              }
              /*
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
  
                  return super.shouldOverrideUrlLoading(view, url);
              }
              */
          });
      }
  
  }
  </code></pre>
  
  <p>Is there a way to get the headers in the plugin before they are read by javascript?</p>