在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