简体   繁体   English

Android 中有没有办法检测我的应用程序是否被卸载?

[英]Is there a way in Android to detect that my App is getting uninstalled?

I want to trigger the logout process for the user in case the user uninstalls my app.我想为用户触发注销过程,以防用户卸载我的应用程序。 This way I want to ensure that I reach the user via other means like SMS / email instead of sending app Notification.通过这种方式,我想确保我通过其他方式(如短信/电子邮件)而不是发送应用程序通知来联系用户。

Is it possible to run some code just before uninstallation of my Android App ?是否可以在卸载我的 Android 应用程序之前运行一些代码?

Is it possible to run some code just before uninstallation of my Android App?是否可以在卸载我的 Android 应用程序之前运行一些代码?

No. You can get the broadcast for any other package getting uninstalled but never for your own package.不可以。您可以为任何其他被卸载的软件包获取广播,但永远不会为您自己的软件包获取广播。

But you can observe other packages being removed by registering for this event.但是您可以通过注册此事件来观察其他软件包被删除。

android.intent.action.PACKAGE_REMOVED

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM