Last activity for intent prior to going to background
<p>When an alarm notification goes off and I activate the app from the notification, I want my application to resume at the same activity as when it was pushed into the background.</p>

<p>Right now, the <code>PendingIntent</code> is coded as follows:</p>

<pre><code>PendingIntent pi = PendingIntent.getActivity(context, 0, new Intent(context, MyAppActivity.class), 0);
</code></pre>

<p>This always resumes at the main activity <code>MyAppActivity</code>.</p>

<p>How can I make it resume at the last activity before it was pushed into the background?</p>
