Frage

Let's say my app sets a repeating alarm (that repeats every day) using the code below:

myAlarmMgrObj.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, myPendingIntent);

What will happen to this pre-set repeating alarm when the user uninstalls my app? Because I have no handle on uninstall, I have no way of knowing when to cancel it.

I am guessing that because there will no longer be a Broadcast Receiver to receive my PendingIntent, the PendingIntent will not start its lifecycle at all. But does this mean that every day, the broadcast will be sent out anyway?

War es hilfreich?

Lösung

What will happen to this pre-set repeating alarm when the user uninstalls my app?

It is the OS's responsibility to cancel the alarm.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top