[英]How to delete files from external storage if application gets uninstalled in android
In my application i stored PDF files into external storage.My requirement is, need to delete all files from SD card, if application gets uninstall. 在我的应用程序中,我将PDF文件存储到外部存储中。我的要求是,如果应用程序被卸载,则需要从SD卡中删除所有文件。
Thanks, AA. 谢谢,机管局。
This is not possible, unless you have another application installed on the phone. 除非您在手机上安装了其他应用程序,否则这是不可能的。
ACTION_PACKAGE_REMOVED
intent will be sent out to all receivers except for your own. ACTION_PACKAGE_REMOVED
意向将发送给所有接收者,但您自己的接收者除外。
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. 正在安装的程序包没有收到此Intent。
http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REMOVED http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REMOVED
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.