title: Notification click: activity already open
body: <p>I have an application with notifications that open a certain activity if I click them. I want that, if I click the notification and the activity is already opened, it's <strong>not</strong> started again, but just brought to front. </p>
  
  <p>I thought I could do it with the flag <code>FLAG_ACTIVITY_BROUGHT_TO_FRONT</code> or <code>FLAG_ACTIVITY_REORDER_TO_FRONT</code>, but it keeps opening it again so I have the activity twice.</p>
  
  <p>This is my code:</p>
  
  <pre><code>event_notification = new Notification(R.drawable.icon,
              mContext.getString(R.string.event_notif_message), System.currentTimeMillis()); 
  Intent notificationIntent = new Intent(mContext, EventListActivity.class);
  notificationIntent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
  sendNotification(event_notification, notificationIntent, mContext.getString(R.string.event_notif_title),
                  body, Utils.PA_NOTIFICATIONS_ID);
  </code></pre>
  
  <p>Can I manage it with flags or should I store a variable in SharedPreferences to check if it's opened or not?</p>
  
  <p>Thanks!</p>