title: How do I clear the most recent webview history entry
body: <p>I am building a webview app with buttons to go forward and back in the webveiw history.
  The problem is that when I type an url into my search bar, the url that I typed in is added to the history, and then webview requests that page from the web.</p>
  
  <p>For instance web servers that detect my user agent as mobile will supply a different page than what I requested.  This puts my forward/back buttons out of sync.</p>
  
  <p>How can I delete a specific history entry?  What I would do is delete the entry that is just before the returned url so as to delete the typed in url.</p>
  
  <p>Any help will be much appreciated.</p>
  
  <p>Thanks</p>
  
  <pre><code>// function to detect when a button is pressed and if it is
    // get the text from the edittext box
    // then condition it to have http attributes
    //
      EditText et = (EditText) findViewById(R.id.UrlText);
      switch (v.getId()) {
          case R.id.buttonClear:
              wv = (WebView) findViewById(R.id.webView1);
              et.setText("");
              Toast.makeText(this, "Clear link", Toast.LENGTH_SHORT).show();
              break;
          case R.id.buttonBack:
              if(wv.canGoBack()){
                  wv = (WebView) findViewById(R.id.webView1);
                  wv.goBack();
                  et.setText(wv.getUrl());
              }
              Toast.makeText(this,"Back",Toast.LENGTH_SHORT).show();
              break;
          case R.id.buttonHome:
              wv = (WebView) findViewById(R.id.webView1);
              et.setText("www.cnn.com");
              String url = et.getText().toString().trim();
              wv.loadUrl("http://" + url);
              String url1 = wv.getUrl();
              Toast.makeText(this,url1,Toast.LENGTH_SHORT).show();
              break;
          case R.id.buttonForward:
              if(wv.canGoForward()){
                  wv.goForward();
              }
              Toast.makeText(this,"Forward",Toast.LENGTH_SHORT).show();
              break;
      }
  </code></pre>