title: Android onKeyDown() not execute on pressing back button
body: <p>Hi after searching on google i come here to ask about help. I use following method to go back when user press back button of device.</p>
  
  <pre><code>@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
  
  
          Log.i("===BACK BUTTON PRESSED===", "BACK BUTTON");
  
          return true;
      } else {
          Log.i("===ELSE BACK BUTTON PRESSED===", "ELSE BACK BUTTON");
  
          return super.onKeyDown(keyCode, event);
      }
  }
  </code></pre>
  
  <p>But logcat does not display any log message.</p>
  
  <pre><code>W/KeyCharacterMap(517): No keyboard for id 0  
  </code></pre>
  
  <p><code>W/KeyCharacterMap(517): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
  </code>
  Please help me to find this.</p>
  
  <p><strong>EDITED QUESTION :</strong>  </p>
  
  <p>This is my entire class.</p>
  
  <pre><code>public class Dreams_Reminder_detail_screen extends Activity {   
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
          moveTaskToBack(true);
          GroupDreams.group.back();
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.dreams_reminder_details_screen);        
  }
  </code></pre>
  
  <p>}</p>