升级Android上运行的应用程序 [英] Upgrading running application on Android

查看:145
本文介绍了升级Android上运行的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应该重新启动应用程序的Andr​​oid系统时,它的升级,而它的运行?

当我们提升我们的应用程序(通过SD卡打开.apk文件)和应用程序正在运行,现有工艺保持各地和升级不会生效,直到我们强制关闭从应用程序管理器应用程序。然而,它是可能的应用是在一些奇怪的状态,不得以某些意图它应该作出反应。所以,我想知道是否,如果我们解决这个特定的中断状态的应用程序将被重新启动或者我们是否需要处理提升自己。

请注意,我know (或者至少是有一些想法)如何以编程方式检测升级。我想知道的是我是否应该或是否应该这样做,如果应用程序在一个正常的状态其他机制。

解决方案
  

应该重新启动应用程序的Andr​​oid系统时,它的升级,而它的运行?

我不知道什么应该是预期的行为。但我知道,它的重新启动应用程序。所以我有一个的BroadcastReceiver 等待 ACTION_PACKAGE_REPLACED 的意图,然后相应地处理应用程序重新启动。

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.

解决方案

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.

这篇关于升级Android上运行的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆