title: Android override back button
body: <p>I have a (custom) listview in Activity1. When I click on a row, Activity2 opens with another (custom) listview. In the rows of both listviews there are a couple of objects: imageview, checkbox, textview.<br>
  When I set all the checkboxes to checked in activity2, and click the BACK button of my phone, the checkbox of the respective row in the listview should be checked. However, when I click the BACK button, nothing happens (checked Logcat, no new rows, no Logs, nothing).<br>
  So I thought I override the BACK button, so when I click on it, Activity1 should open.</p>
  
  <pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
        Intent intentstart = new Intent(Activity2.this, Activity1.class);
        startActivity(intentstart);
        return true;
      }
      return super.onKeyDown(keyCode, event);    
   }
  </code></pre>
  
  <p>This works, but I have scruples. Is this a good solution? Is there a better solution?
  Because this murders the normal behaviour of BACK btn.</p>
  
  <p>NORMAL BEHAVIOUR:</p>
  
  <ol>
  <li>Activity1 opens. I click on a row -> Activity2 opens. I click back -> I see Activity1. I click on a row -> Activity2 opens.......after playing for a couple of minutes and I am at Activity1, I click back and I am at the open screen of my app.</li>
  </ol>
  
  <p>NEW BEHAVIOUR:</p>
  
  <ol>
  <li>Activity1 opens. I click on a row -> Activity2 opens. I click back -> I see Activity1. I click on a row -> Activity2 opens.......after playing for a couple of minutes and I am at Activity1, I click back and Activity2 opens. Then back again->Activity1 opens. Then back again->Activity2 opens and so on until I roll back all the previously opened activities.</li>
  </ol>