卸载应用程序后,Android 6.0及更高版本不会从手机中清除sqlite数据

android 6.0及以上版本中卸载应用程序并再次安装相同的应用程序(相同的软件包)然后它显示旧的sqlite数据,但在卸载应用程序sqlite数据后的较低版本也从手机中清除.

解决方法:

来自doc:

Since Android 6.0 (API 23), Android has offered the Auto Backup for Apps feature as a way for developers to quickly add backup functionality to their apps. Auto Backup preserves app data by uploading it to the user’s Google Drive account, where it is protected by the user’s Google account credentials.

所以当你重新安装应用程序时:

Data is restored whenever the app is installed, either from the Play store, during device setup (when the system installs prevIoUsly installed apps), or from running adb install. The restore operation occurs after the APK is installed, but before the app is available to be launched by the user.

要禁用它,请在应用程序标记添加

android:allowBackup="false">

认值设置为true.

这是doc的链接
https://developer.android.com/guide/topics/data/autobackup.html

相关文章

SQLite架构简单,又有Json计算能力,有时会承担Json文件/RES...
使用Python操作内置数据库SQLite以及MySQL数据库。
破解微信数据库密码,用python导出微信聊天记录
(Unity)SQLite 是一个软件库,实现了自给自足的、无服务器...
安卓开发,利用SQLite实现登陆注册功能