如何当用户选择卸载我的Andr​​oid应用程序删除文件夹 [英] How to delete a folder when user selects uninstall my application in android

查看:182
本文介绍了如何当用户选择卸载我的Andr​​oid应用程序删除文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何删除文件夹,一旦用户选择卸载按钮,我的应用程序。 我想它以编程方式有没有可能做到这一点? 如果是的话让我知道它可能的解决方案。 在此先感谢。

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.

推荐答案

如果您创建的任何文件夹上的设备的外部存储......有没有办法让你当用户卸载你的应用程序调用code。有些事情是自动删除(数据库,任何写入内部存储容量),而不是文件夹上的外部存储。

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.

编辑 - 正如史蒂芬,如果你的目标API级别8或更高版本,可以使用Context.getExternalFilesDir()为您的外部文件,这些将在卸载删除

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.

这篇关于如何当用户选择卸载我的Andr​​oid应用程序删除文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆