Do Android AlarmManagers continue to work after updating the application?

From what I see, if you are planning an endlessly repeating alarm, it will not stop until you reboot the device or delete the application.

I was wondering how they behave in case of updating the application? for example, you download version 1 of an application from the Play Store, for example, and start the application, and this signal starts working. Version 2 is then issued and an automatic or manual update is performed. Does this signal continue to work (or do you have to start the application again to start the alarm)?

In my scenario, I need this, so I hope the answer will be that it just works. However, what happens if you change the alarm code in version 2?

+9
android alarmmanager android-alarms repeatingalarm
source share
2 answers

It seems the answer is that AlarmManager signals continue to work after updating the application for most versions of Android. Of course, for Android 2.2 or higher. UninstallReceiver in AlarmManagerService been updated to handle package updates without AlarmManagerService crashes - see here for an explicit comment:

// This package is updated; do not kill his anxiety.

The code to handle this was not in 2.1 AlarmManagerService.UninstallReceiver

I understand that this is probably the best part of a three year delay to help the OP, but hopefully it can help others.

+13
source share

Do something like this .

Essentially, if every time your application starts, you re-run your PendingIntent with the same identifier, if it works, nothing will happen, and if it does not start, it will start.

Thus, you do not have to worry about losing the alarm after the update.

+1
source share

All Articles