Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to restart a service after upgrading the application on Android?

Tags:

android

After upgrading my application I would like the service to restart if it was running before. Is there any way to do this? I didn't see any Broadcast Intents that I could register for in the manifest.

like image 765
Albert Bloomfield Avatar asked Feb 01 '10 16:02

Albert Bloomfield


1 Answers

You are right that you should be using a BroadcastReceiver.

Have a look at this question about restarting Alarms on upgrade; it shows how you can use the ACTION_PACKAGE_REPLACED Intent to see when an application is upgraded.

like image 168
Dave Webb Avatar answered Oct 17 '22 01:10

Dave Webb