title: Is it possible to call addJavascriptInterface on a WebView created by onCreateWindow?
body: <p>I have a simple browser app, my <code>onCreateWindow</code> looks like this:</p>
  
  <pre><code>if (userGesture) {
              WebView childView = new WebView(webBrowserActivity);
              WebSettings settings = childView.getSettings();
              settings.setJavaScriptEnabled(true);
              settings.setSupportZoom(true);
              settings.setJavaScriptCanOpenWindowsAutomatically(true);
              settings.setBuiltInZoomControls(true);
              settings.setSupportMultipleWindows(true);
              settings.setLoadWithOverviewMode(true);
              settings.setUseWideViewPort(true);
              childView.addJavascriptInterface(new MyInterface(),"NAME");
              &lt;--- code in here to add the view to a ViewPager.
              WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
              transport.setWebView(childView);
              resultMsg.sendToTarget();
              Log.v(TAG, "Opening popup for " + childView.getUrl());
              webBrowserActivity.invalidateOptionsMenu();
              return true;
          } else {
              return false;
          }
  </code></pre>
  
  <p>I have tried adding this interface a bit later down the line, I have also tried calling <code>reload()</code> or <code>loadUrl()</code> after the page is loaded because the documentation says the javascript interface must be added prior to loading the page. None of this has helped. Has anyone done this successfully? </p>
  
  <p>Thanks.</p>
  
  <p>EDIT: I should mention I see this more on 4.4, I am using the desktop debugger for Chrome and I can go into the console and see the <code>window.NAME</code> object on the first webview and not on the second one. On 4.3 it seems to work fairly often. </p>
  
  <p>I edited the code above to show the settings I am using. The javascript interface I am adding to the WebView works just fine when added to the first WebView that gets created when the Activity starts.</p>