Caused by: android.database.sqlite.SQLiteException: no such table: (code 1) Android

后端 未结 16 2343
一整个雨季
一整个雨季 2020-12-15 05:01

We have a sqlite database in our Application. Its working fine for all the users but few of them experiencing the Caused by: android.database.sqlite.SQLiteException: n

16条回答
  •  自闭症患者
    2020-12-15 05:25

    I have had the same issue, when I created an update for app. By google documentation onCreate() from SQLiteOpenHelper is called only when the app is installed first time. So if you want to add a table you need to increment the database version and add

    onUpgrade() { your_table.create(database) }
    

    @Override public void onUpgrade(final SQLiteDatabase database, final int oldVersion, final int newVersion) { YourTable.onCreate(database); }

提交回复
热议问题