Hi everybody!
when I'm trying to run the
ContentValues cv = new ContentValues();
cv.put(table_LocalSettings_Unit, input);
mDb.insert(table_LocalSettings, "", cv);
I got the following error: Error inserting unit = 0; SqliteConstraintException: error code 19 constraint failed. What should be the problem ? The table sql Code is:
"create table if not exists " + table_LocalSettings + "( " + table_LocalSettings_ID
+ " INTEGER PRIMARY KEY NOT NULL , " + table_LocalSettings_MapType
+ " INTEGER NOT NULL , " + table_LocalSettings_Visib + " BIT NOT NULL , "
+ table_LocalSettings_Unit + " INTEGER DEFAULT 0 NOT NULL , "
+ table_LocalSettings_SpeedUnit + " INTEGER NOT NULL , "
+ table_LocalSettings_Alert + " BIT NOT NULL ," + table_LocalSettings_UserID
+ " INTEGER DEFAULT -1 , " + table_LocalSettings_Username + " VARCHAR , "
+ table_LocalSettings_PowerSave + " VARCHAR , " + table_LocalSettings_PremiumUser
+ " INTEGER NOT NULL DEFAULT 0);";