title: How to restore previous activity by clicking on notification
body: <p>When my notification goes off I want to restore the activity that was put into the background, not start a new activity. I've seen some answers about using FLAGS but I don't know how to implement it</p>
  
  <pre><code>contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | INTENT.FLAG_ACTIVITY_SINGLE_TOP);
  </code></pre>
  
  <p>Where do I put this in my code? I tried but it didn't work. Please help!</p>
  
  <pre><code>        ns = Context.NOTIFICATION_SERVICE;
          mNotificationManager = (NotificationManager) getSystemService(ns);
          icon = R.drawable.icon;
          tickerText = "Short Msg";
          when = System.currentTimeMillis();
          notification = new Notification(icon, tickerText, when);
          context = getApplicationContext();
          contentTitle = "MyApp";
          contentText = "Reopen App";
          notification.defaults |= Notification.DEFAULT_SOUND;
          notification.defaults |= Notification.DEFAULT_VIBRATE;
          notificationIntent = new Intent(this, StartTimer.class);
          contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
          notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
  </code></pre>