Auto-restart app after market update

前端 未结 3 1154
滥情空心
滥情空心 2020-12-19 02:47

Anytime I publish a new version of my app in the Market, if the user had enabled the \"auto update\" option, the app will be updated automatically.

The app contains

相关标签:
3条回答
  • 2020-12-19 03:08

    It's something you'll have to test carefully but you should be able to catch it with a broadcast receiver with the action Intent.ACTION_PACKAGED_REPLACED

    Then you start the service from your receiver.

    0 讨论(0)
  • 2020-12-19 03:10

    If your app is running on API 12 or higher, I would recommend registering a BroadcastReceiver listening to android.intent.action.MY_PACKAGE_REPLACED.

    This Intent is only triggered if YOUR application got an update.

    0 讨论(0)
  • 2020-12-19 03:19

    Register a BroadcastReceiver to Intent.ACTION_PACKAGE_REPLACED

    Then, compare EXTRA_UID with your own. If it matches, you can start your service again.

    0 讨论(0)
提交回复
热议问题