Android PackageInstaller, re-open the app after it updates itself

感情迁移 提交于 2019-11-30 19:47:52

Starting from about Android 5 (I don't know the exact API level), Android will send a broadcast Intent with ACTION="android.intent.action.MY_PACKAGE_REPLACED" after your app is updated. Just add

        <intent-filter>
            <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
        </intent-filter>

to your <receiver> declaration and you should be able to listen for this and restart your app in onReceive().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!