title: Android Webview, working with Anchors
body: <p>I am loading a webpage into a webview from the database with the <code>loadDataWithBaseURL()</code> function and am trying to subsequently jump to an Anchor point.  When I place a button just below the webview that uses the <code>loadUrl()</code>-function, it jumps to the Anchor point just fine.  But if I place the <code>loadUrl()</code> after the <code>loadDataWithBaseURL()</code> it says page not found.</p>
  
  <pre><code>webview.loadDataWithBaseURL("app:myhtml", data, "text/html", "UTF-8", null);
  webview.loadUrl("app:myhtml#tips");
  </code></pre>
  
  <p>I assumed it was because the load had not completed, and thus it couldn't find the Anchor, but I tried a loop to wait for it to <code>getProgress()</code> to equal 100, and have verified it's reaching 100 before that command executes, but it still won't find the page unless it's associated with the button click.</p>
  
  <p>Any Ideas out there on how I can load a page from the database and then jump to an anchor point at the same time.  I'm working with the Android 2.1 SDK.</p>
  
  <hr>
  
  <p>Thanks to your help I got it to load directly to my anchor by adding this little bit of code.  However I can't scroll around on the page, it starts to move and then snaps back. I suspect because it is reloading the page to that anchor each time.  I'm fairly new to Android, and Java even, so this may be the wrong implementation of your suggestion, but I'd certainly appreciate a little more direction.  Here is the code I used:</p>
  
  <pre><code>webview.setWebViewClient(new WebViewClient() {  
      @Override  
      public void onPageFinished(WebView view, String url) {
          super.onPageFinished(webview, "app://data");
          webview.loadUrl("app://data#tips");
      }  
  });
  </code></pre>
  
  <p>It seems this is making an infinite loop.</p>