Android SQlite database table, adding column
I'm trying to add a column to my database table which was created a while back and every time i try t开发者_高级运维o run the app with the new column in the database adapter it crashes.
Why is this happening? I have changed the name of the database so it acts like a fresh table but this still doesn't work..
Please help????
If you are using a subclass of SQLiteOpenHelper
as a lot of the Android examples suggest, you need to increment the DB_VERSION int that gets passed to the constructor. Otherwise the onUpgrade
method doesn't get called and your db schema doesn't change.
精彩评论