简体   繁体   English

如果在Android中卸载了应用程序,如何从外部存储中删除文件

[英]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.

相关问题 如何写入 android 中的外部存储,即使在卸载应用程序后仍然存在? - How to write to the external storage in android that will be present even after the application is uninstalled? MAUI应用程序如何从Android外部存储读取文件 - How to read files from Android external storage in MAUI application Android:在卸载时从外部存储中删除应用相关文件? - Android: Delete app associated files from external storage on Uninstall? Android,如何防止卸载应用程序时删除内部存储文件 - Android, how to prevent internal storage files to be deleted when the app is uninstalled Android:如何从外部存储中删除文件? - Android: How to remove files from External storage? 我想删除Android组在ANDROID中卸载时的联系人组(在安装时创建) - I want to delete contact group(created at installation time) at the time of my android application gets uninstalled in ANDROID 使用保存在Android应用程序外部存储中的文件 - Using files saved on external storage in android application Android:从公共外部存储中删除文件 - Android : Delete file from public external storage 如何检查应用程序是否已从android / iphone设备上卸载 - How to check if application is uninstalled from android/ Iphone device 如何获取Android应用程序尝试从设备中删除/卸载的操作 - How to get action that android application is trying removed/uninstalled from device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM