sqlite database version not getting set - android
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.
精彩评论