Reputation: 76236
Is Android system supposed to restart an application when it's upgraded while it's running?
When we upgrade our application (by opening the .apk from SD card) and the application is running, the existing process stays around and the upgrade does not take effect until we "force close" the application from application manager. However it is likely that the application is in some weird state and may not respond to some intents it should. So I want to know whether the application would be restarted if we fix that particular broken state or whether we need to handle the upgrade ourselves.
Note, that I know (or at least have some ideas) how to detect the upgrade programmatically. What I want to know is whether I am supposed to or whether there is some other mechanism that should do it if the application is in a sane state.
Upvotes: 8
Views: 898
Reputation: 4480
as far as I know. it's looks like restarting. but the real process is : the application got uninstalled then installed again with the upgraded version. because it is uninstalled , of course it will automatically closed.
in your case it seems your application don't want to close and the so uninstall process not going.
Upvotes: 0
Reputation: 1544
Is Android system supposed to restart an application when it's upgraded while it's running?
I dont know what should be the expected behaviour. But I know that it does not restart the app. So I have a BroadcastReceiver
waiting for the ACTION_PACKAGE_REPLACED
intent and then handle the app restart accordingly.
Upvotes: 2