Result after finishing an intent
<p>I have a service that is running which will bring up an activity (<code>MyActivity1</code>). If you normally start my application, <code>MyActivity2</code> is the default activity that is launched. </p>

<p>This is the behavior that i am getting</p>

<ol>
<li>Service shows a notification in the notification bar</li>
<li>User clicks on the notification </li>
<li>MyActivty1 is launched</li>
<li>They finish doing whatever in this activity and I call <code>finish()</code> to end the activity</li>
<li>They are brought back to my application and <code>MyActivity2</code> is shown. </li>
</ol>

<p>In step 5, the behavior I would like is for them to return to the main screen rather than open my activity. How could this be achieved?</p>

<pre><code>Context context = getApplicationContext();
Intent intent = new Intent(context, ExchangeConfigActivity.class);
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, 0);
CharSequence from = getString(R.string.app_name);
CharSequence message = "Exchange Account - Setup Required";
Notification notif = new Notification(R.drawable.icon,"Message", System.currentTimeMillis());
notif.setLatestEventInfo(getApplicationContext(), from, message, contentIntent);
notif.flags = Notification.FLAG_AUTO_CANCEL;
nm.notify(id, notif);
</code></pre>
