title: Press back button to another activity
body: <p>I try the code below to call another activity while pressing the back button:</p>
  
  <pre><code>@Override
  public boolean onKeyUp(int keyCode, KeyEvent msg) {
     switch(keyCode) {
         case(KeyEvent.KEYCODE_BACK):
         Intent intent = new Intent(AActivity.this, BActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);  
         Window w = NASGroup.group.getLocalActivityManager().startActivity("BActivity", intent);  
         View view = w.getDecorView();  
         MyGroup.group.setContentView(view);  
         return true; 
     }
     return false;
  }
  </code></pre>
  
  <p>But when I press the back button, it get out of the app.
  I see the logcat, it does not run the function <code>onKeyUp</code> and doesn't output any message.
  The same code in <code>onKeyUp</code>, I try to below code to a button in layout and it works.</p>
  
  <pre><code>cancel.setOnClickListener(new OnClickListener() {
     @Override
     public void onClick(View v) {
        Intent intent = new Intent(AActivity.this, BActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);  
        Window w = NASGroup.group.getLocalActivityManager().startActivity("BActivity", intent);  
        View view = w.getDecorView();  
        MyGroup.group.setContentView(view);  
     }
  });
  </code></pre>
  
  <p>How can I modify it?</p>