title: Returning to the proper activity when pressing the BACK button?
body: <p>I'm creating an app with multiple screens the user will have to navigate through. Specifically, I'm currently working on a set of activities that must link together as follows:</p>
  
  <ul>
  <li>Main Activity -> a button click leads to "CreateCharacterActivity" -> a button click leads to "CharacterMainActivity"</li>
  <li>The BACK button on "CharacterMainActivity" should lead back to MainActivity without showing the CreateCharacterActivity again.</li>
  <li>This behavior should be similar in other areas of the app, except it should restore the state the activity the BACK button leads to was in before it was paused.</li>
  </ul>
  
  <p>So to simplify, I want it like this.</p>
  
  <ul>
  <li>Activity A -> Activity B -> Activity C</li>
  <li>BACK button causes Activity C to return to Activity A without going through Activity B.</li>
  </ul>
  
  <p>I tried doing this:</p>
  
  <pre><code>@Override
  public void onBackPressed() {
      super.onBackPressed();
      Intent intent = new Intent(this, MainActivity.class);
      startActivity(intent);
      finish();
  }
  </code></pre>
  
  <p>But this just invokes a new instance of MainActivity. When I then press BACK at that MainActivity instance, it takes me back to CharacterMainActivity.</p>
  
  <p>How can I achieve this? I'm assuming it involves accessing the Activity stack?</p>