title: pendingIntent getBroadcast : to check if status bar notification is already tapped by user
body: <p>I am creating status bar notification from service which is always running in background.
  I want to cancel the notification if user has not tapped it for 5 minutes. </p>
  
  <p>So how do I check if status bar notification is still active??</p>
  
  <p>I found out that we can pendingIntent getBroadcast with FLAG_NO_CREATE, if it returns Non Null then it means status bar notification is still active. But for me it alwasy returns null even though status bar notification is active. Please find the code below.</p>
  
  <p>Please let me know if I am doing anything wrong.</p>
  
  <p>Code :</p>
  
  <pre><code>/* Notification intent creation */
  
  Intent notificationIntent = new Intent(Intent.ACTION_MAIN, null);
              notificationIntent = new Intent(Intent.ACTION_MAIN, null);
              notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
  
              final ComponentName cn = new ComponentName("com.ActivityTrackingUI", "com.ActivityTrackingUI.Main");
              notificationIntent.setComponent(cn);
  
  /* check */
  
              if(PendingIntent.getBroadcast( this, 0, notificationIntent, PendingIntent.FLAG_NO_CREATE) != null)
              {
                  Log.e("","notification present");
              }
              else
                  Log.e("","notification not present");
  </code></pre>
  
  <p>always prints notification not present</p>