title: How to get and cancel a PendingIntent?
body: <p>I have an <code>alarmManager</code> which I am using to send notifications to the user at specific times.  Since there are multiple alarms, I have multiple pending intents that I am creating and giving a unique ID, However there are certain situations in which I will need to get all the pending intents and then cancel them, so I can reset the alarms.  I have tried doing this and I still cant seem to get it right so I have a couple questions:</p>
  
  <p>Is this how you would correctly get and cancel a <code>PendingIntent</code>?</p>
  
  <pre><code>Intent intent = new Intent(con, AppointmentNotificationReciever.class);
  PendingIntent sender = PendingIntent.getBroadcast(con, id, intent,
          PendingIntent.FLAG_CANCEL_CURRENT);
  AlarmManager am = (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);
  am.cancel(sender);
  </code></pre>
  
  <p>Does the intent need to exactly match that of the original pending intent(extras and all)?</p>
  
  <p>Does the <code>PendingIntent</code> flag need to match that of the original pending intent?</p>