How to delete a folder when user selects uninstall

2019-01-26 13:24发布

I would like to know about how to delete a folder once user select uninstall button for my application. I want it by programmatically is there any chance to do it... If so let me know possible solution for it. thanks in advance.

1条回答
ら.Afraid
2楼-- · 2019-01-26 13:59

If you created any folders on a device's external storage... there is no way for you to call code when the user uninstalls your app. Certain things are removed automatically (databases, anything written to Internal Storage), but not folders on external storage.

EDIT - As pointed out by Stephan, if you are targeting API Level 8 or higher, you can use Context.getExternalFilesDir() for your external files and those will be removed on uninstall.

查看更多
登录 后发表回答