title: How to display About screen and skip back button with webview
body: <p>I'm making an application that has a menu with the navigation view and webview. One of the menu item is About, how to display the contents About in the small size of the screen that consist of image and text about the application and developer.</p>
  
  <p>And if after I choose the About menu and then select another menu, if I click the back button, I don't want it to re-display the About screen but back to previous content before I click About. Thanks.</p>
  
  <p>This is my activity code</p>
  
  <pre><code>package com.example.intaportalapp;
  
  import android.support.design.widget.NavigationView;
  import android.support.v4.widget.DrawerLayout;
  import android.support.v7.app.ActionBarDrawerToggle;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.support.v7.widget.Toolbar;
  import android.view.KeyEvent;
  import android.view.MenuItem;
  import android.view.View;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  
  public class MainActivity extends AppCompatActivity {
      WebView myWebView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          myWebView = (WebView) findViewById(R.id.myWebView);
  
          WebSettings webSettings = myWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          myWebView.setWebViewClient(new MyWebViewClient());
          myWebView.loadUrl("http://www.example.com");
  
          myWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
  
          //Setting Navigation View Item Selected Listener to handle the item click of the navigation menu
          navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
              @Override
              public boolean onNavigationItemSelected(MenuItem menuItem) {
                  if (menuItem.isChecked()) menuItem.setChecked(false);
                  else menuItem.setChecked(true);
  
                  //Closing drawer on item click
                  drawerLayout.closeDrawers();
  
                  //Check clicked item and perform appropriate action
                  switch (menuItem.getItemId()) {
  
  
                      //Populating main content using webview on the basis of selected menu item
                      case R.id.home: {
                          myWebView.loadUrl("http://www.example.com");
                          return true;
                      }
                      case R.id.portal: {
                          myWebView.loadUrl("http://portal.example.com");
                          return true;
                      }
                      case R.id.ess: {
                          myWebView.loadUrl("http://www.humanenergy.com");
                          return true;
                      }
                      case R.id.about: {
                          myWebView.loadUrl("file:///android_asset/about/index.html");
                          return true;
                      }
                      case R.id.exit: {
                          finish();
  
                      }
                      default: {
                          return false;
                      }
                  }
  
              }
          });
  
  
          ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.close, R.string.open) {
  
  
              @Override
              public void onDrawerClosed(View drawerView) {
                  // Code here will be triggered when the drawer closes
                  super.onDrawerClosed(drawerView);
              }
  
              @Override
              public void onDrawerOpened(View drawerView) {
                  // Code here will be triggered when the drawer will open
                  super.onDrawerOpened(drawerView);
              }
          };
  
          //Setting the actionbarToggle to drawer layout
          drawerLayout.addDrawerListener(actionBarDrawerToggle);
  
          //calling sync state is necessay or else your hamburger icon wont show up
          actionBarDrawerToggle.syncState();
  
      }
  
      private class MyWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              myWebView.loadUrl(url);
              return true;
          }
      }
  
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; myWebView.canGoBack()) {
              myWebView.goBack(); // Go to previous page
              return true;
          }
          // Use this as else part
          return super.onKeyDown(keyCode, event);
      }
  
  }
  </code></pre>