gpt4 book ai didi

Android 6.0及以上版本卸载应用后不清除手机中的sqlite数据

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:19:16 24 4
gpt4 key购买 nike

在 android 6.0 及更高版本中,当您卸载应用程序并再次安装相同的应用程序(相同的包)时,它会显示旧的 sqlite 数据,但在卸载应用程序后的较低版本中,sqlite 数据也会从手机中清除。

最佳答案

来自文档:

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。

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

关于Android 6.0及以上版本卸载应用后不清除手机中的sqlite数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44193964/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com