title: finish() is closing two activities instead one
body: <p>I've made an app that does the following:</p>
  
  <p>activity A --> activity B --> activity C</p>
  
  <p>activity A --> activity B2 --> activity C</p>
  
  <p>When you close B, B2 or C, it goes to the previous activity. If you close A, it exits from the app.</p>
  
  <p>If you arrive to C from B, C works in one way, but if you arrive from B2, C works in a bit different way.</p>
  
  <p>This works perfectly in emulator and all devices that I could check, but a problem has appeared in two Xperia (models ARC &amp; U) with android 4.0.4.</p>
  
  <p>The problem appers when they arrive to C from B. When they close C they go back to A instead to B. If they arrive to C from B2, when they close go back to B2.</p>
  
  <p>I can't understand that. It's supposed that C had to work in the same way in both cases.</p>
  
  <p>And the other question is: How is possible that the app works perfectly in all devices except this two?</p>
  
  <p>Any idea? How can I solve this problem?</p>
  
  <p>Editing to add code:</p>
  
  <p>Opening C from B:</p>
  
  <pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {
      // TODO Auto-generated method stub
      switch (position+1) {
      case 1:
          if(random == true){
              AnimalsBD.cmpt = Integer.parseInt(ABD.getNAct(Integer.toString(Aguila.ordre)))+1;
              }
          Intent a = new Intent ("com.android.JIA.Animals.1");
          startActivity(a);
      break;
      case 2:
          if(random == true){
              AnimalsBD.cmpt = Integer.parseInt(ABD.getNAct(Integer.toString(Anec.ordre)))+1;
              }
          Intent b = new Intent ("com.android.JIA.Animals.2");
          startActivity(b);
      break;
  </code></pre>
  
  <p>Opening C from B2:</p>
  
  <pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {     
      // TODO Auto-generated method stub
  
      mpCorrecte = MediaPlayer.create(this, R.raw.correcte);
      mpIncorrecte = MediaPlayer.create(this, R.raw.incorrecte);
  
      if(start){
      switch (position+1) {
      case 1:
          if(numSo==1){
              start = false;
              mpCorrecte.start();
              mpCorrecte.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                  public void onCompletion(MediaPlayer mp) {
                      Intent a = new Intent ("com.android.JIA.Animals.1");
                      startActivity(a);}                  
              });
          }else{
              mpIncorrecte.start();
          }
      break;
      case 2:
          if(numSo==2){
              start = false;
              mpCorrecte.start();
              mpCorrecte.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                  public void onCompletion(MediaPlayer mp) {
                      Intent a = new Intent ("com.android.JIA.Animals.2");
                      startActivity(a);}                  
              });
          }else{
              mpIncorrecte.start();
          }
      break;
  </code></pre>
  
  <p>In both cases I'm opening a final activity from a gridview. All the final activities works equally.</p>
  
  <p>Thank you.</p>