以编程方式清除用户自己的应用程序数据 [英] Clear user own apps data programmatically
问题描述
我正在开发一个应用程序,我希望允许用户设置该应用程序,使其在尝试登录应用程序两次后如果登录失败,它将自动删除所有数据,包括首选项和数据库.
I am developing an app where I want to allow the user to be able to set up that if they fail the login after a couple of attempts into the app, it will automatically delete all the data including the preferences and databases.
是否有一种简单的方法来执行此操作,还是必须编写代码来手动重置应用程序使用的所有内容?
Is there a simple way to do this or do I have to write code to manually reset everything the app uses?
推荐答案
是否有一种简单的方法来执行此操作,或者我必须编写代码来手动重置应用程序使用的所有内容.
Is there a simple way to do this or do I have to write code to manually reset everything the app uses.
您必须编写代码来手动重置应用程序使用的所有内容.这仅是删除少量文件的问题.在尝试删除数据库之前,请确保已关闭数据库.
You have to write code to manually reset everything the app uses. This should just be a matter of deleting a handful of files. Make sure your database is closed before you try deleting it.
这篇关于以编程方式清除用户自己的应用程序数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!