title: Not able to catch android back button event
body: <p>I am trying to catch the back button event for Android. I know there is a lot about this already on the forms, however, my code does not work as the examples given. Here is my code snippet to capture the event:</p>
  
  <pre><code>@Override
  public boolean onKeyDown(int keyCode, KeyEvent event){
      if(keyCode == KeyEvent.KEYCODE_BACK){
          Log.d(TAG, "back key captured");
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>@Override
  public void onBackPressed(){
      Log.d(TAG, "in onBackPressed");
      finish();
  }
  </code></pre>
  
  <p>The output from LogCat that either event got fired doesn't show up. Anyone know a possible reason for this?</p>
  
  <p>Thanks.</p>