不要删除数据库或清除应用程序上的共享偏好设置 [英] Don't delete database or shared Preference on clear app

查看:213
本文介绍了不要删除数据库或清除应用程序上的共享偏好设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要,不要删除共享首选项或数据库清除。它会清除只有当应用程序卸载,我如何可以保持共享偏好或共享偏好安全清除应用程序。

i want, Don't delete shared Preferences or Database on clear. it will clear only when app uninstall, how can i keep shared preferences or shared preference safe on clear app.

推荐答案

值得注意的是,Android中有三种类型的数据清除,其中您的应用程序无法控制:

It is worth noting that there are three types of data clearing in Android, of which your application has no control over:


  • 清除数据

  • 清除缓存

  • 清除默认值

清除数据
清除数据将清除应用程序工作目录下的所有内容。这包括驻留在应用程序目录中的应用程序保存的任何共享首选项,数据库和文件。这也将清除应用程序的缓存,因为它也是应用程序工作目录的一部分。

Clear Data Clear data will clear everything under the application's working directory. This includes any shared preferences, databases and files saved by the application which reside in the application directory. This will also clear the application's cache, as it is also part of the application's working directory.

清除缓存
应用程序访问缓存目录以保存文件,主要用于缓存,如生成的图像或临时文件。

Clear Cache The application has access to a cache directory to save files to, mainly for the purpose of caching such as generated images or temporary files.

清除默认值
此选项将清除注册到此应用程序的任何意图。

Clear Defaults This options will clear any intents registered to this application.

卸载应用程序将清除所有三组数据。因此,在安装之间维护数据的唯一方法是将其保存到外部存储,但请注意,用户和每个应用程序都可以访问外部存储,因此可以随时修改或删除。

Uninstalling an application will clear all three sets of data. Therefore the only way to maintain data between installs is to save it to external storage, but note that both the user and every application has access to the external storage and therefore may be modified or deleted at any point.

链接值得阅读:

http://developer.android.com/guide/topics/data/data-storage.html#

Android:永久保存文件(即使在清除数据/卸载后) )

清除缓存和放大器之间有什么区别?在Android设置中清除数据

这篇关于不要删除数据库或清除应用程序上的共享偏好设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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