Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从外部 URL 更新我的应用程序。如果特定 URL 上的版本文件有任何更改,应用程序会进行检查并开始从 url 下载最新上传的 APK。
下载应用程序后,新的 apk 开始安装,并表示它将替换手机中的现有应用程序。
我的问题:在这种情况下,包含前一个应用程序数据的完整数据库是否被清除?
升级应用程序时,该应用程序创建的任何数据文件都不会受到影响。
当SQLiteOpenHelper检测到数据库文件的版本小于您的应用程序声明的版本时,它会调用onUpgrade.
SQLiteOpenHelper
onUpgrade