gpt4 book ai didi

android - 检测我的应用程序是否已卸载

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:39:38 27 4
gpt4 key购买 nike

是否可以使用代码来检测我的应用程序是否已被卸载,并在卸载时自动删除我的应用程序创建的所有相关文件夹?

谢谢!

最佳答案

关于能够检测到卸载,恐怕是不可能的。

每当应用程序包被删除(应用程序被卸载)时,ACTION_PACKAGE_REMOVED Intent 将被发送给所有接收者EXCEPT 您自己的。

来自文档:-

Broadcast Action: An existing application package has been removed from the device. The data contains the name of the package. The package that is being installed does not receive this Intent.

这是 confirmed here .

关于android - 检测我的应用程序是否已卸载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15286678/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com