title: Finishing an activity / Intent
body: <p>I am making a that program is going into another activity to get some data, and then returning the data through intent to my main activity. The code I have at the moment does open a new activity, it gets and sends the data but seems to 'restart' my main activity when finish() is called.</p>
  
  <p>Question: How do I stop my second activity restarting my main activity?</p>
  
  <p>Main Activity:</p>
  
  <pre><code>Intent intent = new Intent(AndroidVideoPlayer.this, FileChooser.class);
  intent.putExtra("dir", 1);
  startActivityForResult(intent, requestCode);
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      Log.d("CheckStartActivity","onActivityResult and resultCode = "+resultCode);
      // TODO Auto-generated method stub
  
      myPath = data.getStringExtra("stringPath");
      textEmpty.setText(myPath);
      myUri = Uri.parse(myPath);      
      mp = MediaPlayer.create(this, myUri);   
  }
  </code></pre>
  
  <p>Secondary Activity:</p>
  
  <pre><code>Intent intent = new Intent(FileChooser.this,AndroidVideoPlayer.class);
  intent.putExtra("stringPath",intentPath1);
  setResult(1,intent);
  finish(); // &lt;--- does close activity, but restarts main activity
  </code></pre>