title: Detect that an activity has closed in Android
body: <p>In my application I need to launch a SelectionActivity to select one of the options. Once the option has been selected I need to refresh another list on the MainActivity.</p>
  
  <p>This is the code that I use to launch the SelectionActivity:</p>
  
  <pre><code>Intent intent = new Intent(MainActivity.this, SelectionActivity.class);
  startActivity(intent);
  </code></pre>
  
  <p>In SelectionActivity this is the code that receives the selected option an closes the activity:</p>
  
  <pre><code>selectedValue = adapter.getItem(position);
  finish();
  </code></pre>
  
  <p>Now the application comes back to MainActivity but I don't know how to receive an event that the SelectionActivity has closed.</p>
  
  <p>Thanks</p>