Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looking at the AlarmManager documentation for the cancel method you're using:</p> <blockquote> <p><a href="http://developer.android.com/reference/android/app/AlarmManager.html#cancel%28android.app.PendingIntent%29" rel="nofollow">public void cancel (PendingIntent operation)</a></p> <p>Added in API level 1</p> <p>Remove any alarms with a matching Intent. Any alarm, of any type, whose Intent matches this one <strong>(as defined by <a href="http://developer.android.com/reference/android/content/Intent.html#filterEquals%28android.content.Intent%29" rel="nofollow">filterEquals(Intent)</a>)</strong>, will be canceled.</p> </blockquote> <p>So, the Intent.filterEquals documentation says the following:</p> <blockquote> <p><a href="http://developer.android.com/reference/android/content/Intent.html#filterEquals%28android.content.Intent%29" rel="nofollow">public boolean filterEquals (Intent other)</a></p> <p>Added in API level 1 </p> <p>Determine if two intents are the same for the purposes of intent resolution (filtering). That is, <strong>if their action, data, type, class, and categories are the same</strong>. This does not compare any extra data included in the intents.</p> </blockquote> <p>I can't think of any reason why the action, data, type, class, or category would be different from one explicit Intent to another (unless, obviously you went out of your way to change those things). The contexts do not appear to be in the criteria for the matching, so I think you can be fairly confident that it will be cancelled no matter which context was used to create it in the first place.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload