title: Open Activity with backwards to MainActivity in my app
body: <p>I'm stuck with some activity's flow issue. The desired behaviour is the following:</p>
  
  <p>From time to time, the user receives a notification. When this notification is clicked, a new <code>Activity</code> is opened with some information in it. In this Activity, there's a button whose purpose is to redirect the user to another <code>Activity</code> where more detailed information is showed. When the user is in the details Activity and presses the back button (or the back button in the <code>ActionBar</code>) this one is closed and the Main Activity is showed (this one is different from the one I mentioned in first place).</p>
  
  <p>Everything works fine except from the last part. When the user presses the back button the application is closed and it is showed the Home Screen. Why is that happening?</p>
  
  <p>Here is my <code>AndroidManifest.xml</code>:</p>
  
  <pre><code>&lt;activity
      android:name=".MainActivity"&gt;
  &lt;/activity&gt;
  
  &lt;activity
      android:name=".DetailActivity"
      android:label="@string/title_detail_activity"
      android:parentActivityName="solar.panik.MainActivity" &gt;
      &lt;!-- Parent activity meta-data to support 4.0 and lower --&gt;
      &lt;meta-data
          android:name="android.support.PARENT_ACTIVITY"
          android:value="solar.panik.MainActivity" /&gt;
  &lt;/activity&gt;
  
  &lt;activity
      android:name=".NotificationActivity"
      android:theme="@style/NotificationActivity"      
      android:excludeFromRecents="true"&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>Here is the onClick code for the button that starts the <code>DetailActivity</code> from the <code>NotificationActivity</code>:</p>
  
  <pre><code>Intent intent = new Intent(NotificationActivity.this, DetailActivity.class);
  startActivity(intent);
  finish();
  </code></pre>
  
  <p>Thanks in advance</p>