在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
原文地址:https://codeday.me/bug/20190627/1307234.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。