title: Notification opens activity, back button pressed, main activity is opened?
body: <p>The best way I can describe my problem is like this:</p>
  
  <ol>
  <li>A notification is created at boot (with a <code>BroadcastReceiver</code>).</li>
  <li>My app main activity is opened and the home button is pressed (the app is still running in the background until the system closes it).</li>
  <li>I pull down the status bar and press on the notification previously created at boot.</li>
  <li>Some activity, different from the main one, is started.</li>
  <li>I press the back button and the main activity is displayed.</li>
  </ol>
  
  <p>How can I prevent that last step? What I want with the back button is to go back where I was, which is the home screen (the desktop with all the widgets and app icons). My app's main activity was supposed to be running on the background, why was it called with the back button?</p>
  
  <p>In case it's relevant, my code to create a notification goes like this:</p>
  
  <pre><code>public void createNotification(int notifyId, int iconId, String contentTitle, String contentText) {
      Intent intent = new Intent(mContext, NewNoteActivity.class);
      intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      intent.putExtra(AgendaNotesAdapter.KEY_ROW_ID, (long)notifyId);
  
      PendingIntent contentIntent = PendingIntent.getActivity(mContext, notifyId, intent, 0);
  
      Notification notification = new Notification(iconId, contentTitle, 0);
      notification.setLatestEventInfo(mContext, contentTitle, contentText, contentIntent);
  
      mNotificationManager.notify(notifyId, notification);
  </code></pre>
  
  <p>I tried to add a couple of more flags combinations to <code>intent</code> but neither of them solved my problem... Suggestions?</p>