title: Android - Cant refresh webview from js interface
body: <p>I have a webView, and I am scraping the HTML:</p>
  
  <pre><code>webView.addJavascriptInterface(new WebScraper(), "HtmlViewer");
  view.loadUrl("javascript:HtmlViewer.showHTML" +
  "('&lt;html&gt;'+document.getElementsByTagName('html')[0].innerHTML+'&lt;/html&gt;');");
  </code></pre>
  
  <p>And the parameter <code>html</code> contains the whole HTML page:</p>
  
  <pre><code>@JavascriptInterface
  public void showHTML(String html) {       
     scrapePage(html);
  }
  </code></pre>
  
  <p>Now the problem is, sometimes my HTML page shows an error message if the data hasnt fully loaded, or AJAX calls failed. When that happens I want to refresh the page. So i did:</p>
  
  <pre><code> if (matcher.find()) {
       id = matcher.group(1);
  
       getLecture(dom);
   } else {
       Log.d("errors", "looks like player didnt load try again by refreshing page");
       webView.post(new Runnable() {
            @Override
            public void run() {
                webView.reload();
                              }
            });
       }
  </code></pre>
  
  <p>But it doesnt look like my <code>showHTML(String html)</code> method is called again after refreshing. I was hoping someone could help me.</p>
  
  <p>thnkas</p>