title: How to determine if Android App open from Notification message?
body: <p>In general, when i have notification message on the notification bar and click on it. It open the registered App for that message. </p>
  
  <p>On Startup's Activity, How to determine if App is open from it? </p>
  
  <p>and more better is How to retrieve the notification's id on the OnCreate() method?</p>
  
  <p><strong>Update</strong>: from @Ovidiu - here is my code to putExtra to push</p>
  
  <pre><code>       Notification notification = new Notification(icon, tickerText, System.currentTimeMillis());
         notification.contentView = contentView;
  
         Intent notificationIntent = new Intent(this, Startup.class);
         notificationIntent.putExtra("JOBID", jobId);
  
         PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT);
  
         notification.flags = Notification.FLAG_AUTO_CANCEL;
         notification.contentIntent = contentIntent;
  
  
         mNotificationManager.notify(jobId, notification);
  </code></pre>
  
  <p>and on Main Activity "Startup.java" code is</p>
  
  <pre><code>    Intent intent = this.getIntent();
      if (intent != null &amp;&amp; intent.getExtras() != null &amp;&amp; intent.getExtras().containsKey("JOBID")) {
          int jobID = this.getIntent().getExtras().getInt("JOBID");
  
          if (jobID &gt; 0) {
  
          }
      }
  </code></pre>
  
  <p>intent.getExtras() always return null. Turn out, I need to pass PendingIntent.FLAG_ONE_SHOT . It is now passed along!! </p>