开发者

sqlite database version not getting set - android

开发者 https://www.devze.com 2023-04-04 10:13 出处:网络
I am trying to set the version number of my sqlite da开发者_运维技巧tabase, because I would like to upgrade it in the OnUpgrade method of my SQLiteHelper class. My helper class constructor is the foll

I am trying to set the version number of my sqlite da开发者_运维技巧tabase, because I would like to upgrade it in the OnUpgrade method of my SQLiteHelper class. My helper class constructor is the following:

public DataBaseHelper(Context context){
super(context, DB_NAME, null, 1);
}

However, when I check the version of the database in the "openDataBase()" method, the version number is 0. What gives?


I found the problem: I needed to instantiate my database from the constructor.

0

精彩评论

暂无评论...
验证码 换一张
取 消