Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android AlarmManager not firing after Google Play update

I've created an App reminding people to take madications on time. Every time, after I place a new APK on the Google Play, I get many complaints the alarm doesn't work anymore. It begins working again only after the user starts the App (or reboots). Help!

like image 905
Rotem Avatar asked Jul 22 '13 04:07

Rotem


2 Answers

Check out the ACTION_MY_PACKAGE_REPLACED intent action (on honeycomb and up).

You should be able to register a broadcast receiver for it in the manifest that can then reschedule your alarms.

like image 95
orip Avatar answered Nov 13 '22 07:11

orip


Scheduled alarms will NOT be cancelled on upgrades. I verified this for Android versions 2.2 and 4.3 and the latest Google Play at the time of writing.

What you have to make sure is that your new versions can handle all pending intents of any older version. That means:

  • same target definition in the manifest (broadcast receiver or service)
  • same intent "contract": actions, extras, etc.
like image 34
Jörg Avatar answered Nov 13 '22 07:11

Jörg