Activity not closing after being started my Notification
<p>I am experiencing a weird behavior on my android application. When I open my application, I see my DashboardActivity, then I hit home button or back button and my application closes. This is ok. Then I receive a push message and with this push message I create a notification. The notification works fine, I click the notification and it opens my activity, using the code below:</p>

<pre><code>Intent notificationIntent = new Intent(context, BookingOfferActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
Bundle b = new Bundle();
b.putSerializable("booking", booking);
notificationIntent.putExtras(b);

PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
</code></pre>

<p>Then I execute some task in this BookingOfferActivity activity and call the method finish() to make sure this activity will be finished no matter what. Then I open my application again, but instead of seeing the DashboardActivity I am still seeing BookingOfferActivity.</p>

<p>I have tried the solution proposed here:</p>

<p><a href="http://stackoverflow.com/questions/3111362/prevent-new-activity-instance-after-clicking-on-notification">Prevent new activity instance after clicking on notification</a></p>

<p>but it just doesnt work.</p>

<p>Is there a way to force my application to always open on the DashboardActivity?</p>

<p>Thanks</p>

<p>T</p>
