An error occurs when I try to add mulitple rows to the sqlite database. With a single row theres no problem. Additionally the app crashes due to this on a samsung galaxy s2, but not on a nexus.
Heres the code for creating the table:
private static final String DATABASE_CREATE = "create table "
+ TABLE_AWARDS + "(" + COLUMN_ID
+ " integer primary key autoincrement, " + COLUMN_TITLE
+ " text not null, " + COLUMN_DESCRIPTION + " text not null, "
+ COLUMN_TYPE + " integer not null, " + COLUMN_ACHIEVED
+ " integer not null " + ");";
And the code which inserts the rows into the table:
private static final String DATABASE_INSERT = "INSERT into awards (title, description, type, achieved) VALUES "
+ "('Speed maximum', 'Stay', 1 , 0),"
+ "('Speed maximum', 'under 130 km/h', 2 , 0);";
According to the answer of the stackoverflow question you've given me the syntax should be:
private static final String DATABASE_INSERT = "INSERT into 'awards' "+
"SELECT 'Speed maximum' AS 'title', 'under 150 km/h' AS 'description', 1 AS 'type', 0 AS 'achieved'"
+" UNION SELECT 'Speed maximum', 'under 130 km/h', 2 , 0"
+" UNION SELECT 'Speed maximum', 'under 100 km/h', 3 , 0";
But this doesn't work either.