I have a little problem with inserting data in sqlite in Android. I wrote a method which do that with ContentValues,but it's not working properly. Here is the method :
DatabaseHelper.class
public boolean executeQuery(String tableName,String keys,Object value){
return execQuery(tableName,keys,value);
}
private static boolean execQuery(String tableName,String key,Object value){
sqliteDb = instance.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(key, value.toString());
sqliteDb.insert(tableName, null, values);
return true;
}
And I'm using this like that :
dbHelper.executeQuery("users", "seed", seed); // string
dbHelper.executeQuery("users", "id", id); // int
dbHelper.executeQuery("users", "name", name); // string
dbHelper.executeQuery("users", "lang", lang); // string
And the problem is that I this method insert all values as single row in database,but I want all data to be a part of one row.
What I have to do to get the things to work correctly? I'm not really good with sqlite,so please excuse me if my question is a little silly...
Thanks in advance!