AlarmManager und Intents wieder canceln

  • Antworten:0
Mac Systems
  • Forum-Beiträge: 1.727

31.01.2010, 03:20:34 via Website

Über den AlarmManager lassen sich auch Alarme wieder löschen, unklar ist mir allerdings wie das
etwas flexibler gestaltet werden könnte. Angenommen Ich habe Alarme für gewisse Aktionen, nun will Ich nur Alarme für Aktion X
löschen, wie wäre hier vorzugehen ?

Die API Doc sagt z.b folgendes:

void android.app.AlarmManager.cancel(PendingIntent operation)

public void cancel (PendingIntent operation)
Since: API Level 1

Remove any alarms with a matching Intent. Any alarm, of any type, whose Intent matches this one (as defined by filterEquals(Intent)), will be canceled.
Parameters
operation IntentSender which matches a previously added IntentSender.
See Also

* set(int, long, PendingIntent)


Sollte Ich jetzt im Intent die filterEquals überschreiben ?


public boolean filterEquals (Intent other)
Since: API Level 1

Determine if two intents are the same for the purposes of intent resolution (filtering). That is, if their action, data, type, class, and categories are the same. This does not compare any extra data included in the intents.
Parameters
other The other Intent to compare against.
Returns

* Returns true if action, data, type, class, and categories are the same.



So ganz klar ist mir nicht was die hier wollen, hat jemand so etwas bereits gemacht ?

thx,
Mac

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten