how to delete a file's on uninstall the android application? [duplicate]
Possible Duplicate:
How to delete files created开发者_如何学C by the application on uninstall?
we have a made a streaming media player in android. in my application send a event file in every 15 min to over server. may be some of the file store in phone memory.
how to delete all file when application uninstall??
please help me out.
Thanks
If it's stored on SD card:
If you're using API Level 8 [Android 2.2] or greater, use getExternalFilesDir() to open a File that represents the external storage directory where you should save your files. [...] If the user uninstalls your application, this directory and all its contents will be deleted.
http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
Files in the directory /data/data/app.package.name
(internal storage) will be removed on uninstall as mentioned in Android - Preserve or delete files created by the application on uninstall
精彩评论