开发者

how to delete a file's on uninstall the android application? [duplicate]

开发者 https://www.devze.com 2023-02-10 15:30 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: How to delete files created开发者_如何学C by the application on uninstall?
This question already has answers here: Closed 10 years ago.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号