Updating a running application on Android

Is it supposed that the Android system should restart the application when it is updated during its launch?

When we update our application (by opening .apk from the SD card) and the application starts, the existing process remains on and the update does not take effect until we “close” the application from the application manager. However, it is likely that the application is in some strange state and may not respond to some intentions that it must fulfill. So I want to know if the application will be restarted if we fix this broken condition or if we need to process the update ourselves.

Note that I know (or at least has some ideas) how to detect an update programmatically. I want to know if I should assume if there is another mechanism that should do this if the application is in a normal state.

+8
android android-install-apk
source share
2 answers

Is it supposed that the Android system should restart the application when it is updated during its launch?

I do not know what the expected behavior should be. But I know that it does not restart the application . So I have a BroadcastReceiver waiting for the intent ACTION_PACKAGE_REPLACED , and then handle it accordingly.

+2
source share

as far as I know. it is like restarting. but the real process: the application was uninstalled and then installed again with the updated version. because it is removed, of course, it automatically closes.

in your case, it seems that your application does not want to close, and the uninstall process is not performed.

0
source share

All Articles