Get the Intent that woke up my activity
<p>I'm developing an application that includes a broadcast receiver.
The broadcast receiver sets a notification onReceive(), which includes a pending Intent </p>

<pre><code>Intent updateHistoryIntent = new Intent(this, NotificationsHistory.class);
updateHistoryIntent.putExtra("test", 3);
PendingIntent updateHistoryPendingIntent 
    = PendingIntent.getActivity(this, 0, updateHistoryIntent, 0);

Notification notification 
    = new Notification(icon, contentTitle, System.currentTimeMillis());
notification.setLatestEventInfo(
   context, contentTitle, 
   contentText, updateHistoryPendingIntent
);
</code></pre>

<p>In the NotificationsHistory Activity, I am receiving this Intent in onResume() with:</p>

<pre><code>int testInt = this.getIntent().getIntExtra("test", -1);
Aux.log("test : " + testInt);
</code></pre>

<p>which prints:</p>

<ul>
<li>3: when the activity was destroyed</li>
<li>-1: when the activity was sleeping</li>
</ul>

<p>If I read the docs correctly, <code>this.getIntent()</code> will return the Intent that initially started the Activity and the behavior I described is as expected. </p>

<p>So my question is: <strong>How can I get the Intent that woke up my activity?</strong></p>
