为什么SQLite数据库从应用程序管理结算应用程序的数据清除? [英] Why SQLite database cleared on clearing data of application from Application Management?

查看:146
本文介绍了为什么SQLite数据库从应用程序管理结算应用程序的数据清除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建使用SQLite它首先创建数据库,然后允许用户插入和查看插入记录的简单数据库应用程序。但是,当从Android手机的应用程序设置我清晰的数据,该数据库中的数据也被清除。这是为什么,是有什么办法preserve数据,即使用户清楚它设置?

I created a simple database application using SQLite which first creates database and then allow users to insert and view inserted records. But when I clear data from Application Settings of android phone, the data of the database is also cleared. Why is this and is there any way to preserve data even the user clear it from Settings?

推荐答案

当你创建一个数据库,创建的Andr​​oid在/数据库文件夹一个新的数据库文件。当你删除数据,取消的Andr​​oid应用程序中的文件夹中创建的每个文件,包括/数据库文件夹。您应该使用持久的数据库就像内容提供商

When you create a database, Android create a new database file in the /databases folder. When you delete data, Android cancel every files created in the application folder, included the /database folder. You should use a persistent DataBase like the Content Provider

这篇关于为什么SQLite数据库从应用程序管理结算应用程序的数据清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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