Can you guys see anything wrong with a db table creation statement?
CREATE TABLE userdata(_id INTEGER PRIMARY KEY AUTOINCREMENT,title TEXT, login TEXT, password TEXT, notes TEXT, favorite INTEGER DEFAULT 0);
I use this String to create a db table:
public static final String CREATE_DATABASE = "CREATE TABLE " + TABLE_NAME
+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT," + COLUMN_NAME_TITLE + " TEXT, "
+ COLUMN_NAME_LOGIN + " TEXT, " + COLUMN_NAME_PASSWORD + " TEXT, " + COLUMN_NAME_NOTES
+ " TEXT, " + COLUMN_NAME_FAV + " INTEGER DEFAULT 0);";
db.execSQL(CREATE_DATABASE);
But after all I don’t have the latest (COLUMN_NAME_FAV) column in a table, I don’t understand why. Here how I check:
c.getColumnIndex(COLUMN_NAME_FAV);
returns me -1, meaning theres is no such a column.
The column is only present in your Cursor if you have included that column in your
SELECTquery from which the Cursor is obtained.Make sure your query includes something like