title: How to prevent GOBACK button for specific URL in Android Webview?
body: <p>I have an web application that work on my Android <code>WebView</code> with out problem.</p>
  
  <p>Here is my Android app launcher code:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  WebView webView;
  
  private String urlAddress = "http://www.YourDomainName.com/TheLoginPage";
  private String loadingTxt = "Loading";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Toast loadingMsg = Toast.makeText(this,
              loadingTxt, Toast.LENGTH_SHORT);
      loadingMsg.show();
  
      webView = (WebView) findViewById(R.id.webview);
      webView.getSettings().setJavaScriptEnabled(true);
      webView.loadUrl(urlAddress);
      webView.setWebViewClient(new myWebViewClient());
      webView.setInitialScale(1);
      webView.getSettings().setUseWideViewPort(true);
  }
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (event.getAction() == KeyEvent.ACTION_DOWN) {
          switch (keyCode) {
              case KeyEvent.KEYCODE_BACK:
                  if (webView.canGoBack()) {
                      webView.goBack();
                  }
                  return true;
          }
      }
      return super.onKeyDown(keyCode, event);
  }
  </code></pre>
  
  <p>Every thing is working.</p>
  
  <p><strong>My Question:</strong> the default start page in the WebView is the web application login page. After a successful login process I want to prevent (build in) <strong>GO BACK</strong> button to back page to the default start page (login page) since I am successfully logged in?</p>
  
  <p><strong>Note:</strong> I will still use the <strong>GO BACK</strong> button to the rest of the web application or if I logout out again.</p>