可能重复:
How to delete files created by the application on uninstall?如何删除一个文件的卸载android应用程序?
我们有一个在android系统做了一个流媒体播放器。在我的应用程序中每15分钟发送一个事件文件到服务器。可能是手机内存中的一些文件存储。
如何在应用程序卸载时删除所有文件?
请帮我一把。
感谢
可能重复:
How to delete files created by the application on uninstall?如何删除一个文件的卸载android应用程序?
我们有一个在android系统做了一个流媒体播放器。在我的应用程序中每15分钟发送一个事件文件到服务器。可能是手机内存中的一些文件存储。
如何在应用程序卸载时删除所有文件?
请帮我一把。
感谢
如果它存储在SD卡上:
如果您使用API等级8的Android 2.2]或 更大,使用getExternalFilesDir()来 打开表示文件 外部存储目录 应该保存您的文件。 [...]如果 用户卸载 s你的 应用程序,该目录和所有 其内容将被删除。
http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
目录中的文件/data/data/app.package.name
(内部存储器)将上卸载如Android - Preserve or delete files created by the application on uninstall
提到去除另见http://stackoverflow.com/questions/2874412/get-application- uninstall-event-in-android – 2011-02-12 09:38:48