Я создаю таблицу следующим образом:
DB_CREATE = "create table " + DB_TABLE + " (" +
"id" + " integer, " +
"title" + " text, " + "author" + " text, " +
"image" + " text, " + "time" + " text, " +
"detail" + " text);";
_db.execSQL(DB_CREATE);
, которая _db является ссылкой на SQLiteDatabase.Я вызываю метод insert () следующим образом:
ContentValues newValues = new ContentValues();
if(object instanceof NewsBean) {
newValues.put("id", ((NewsBean) object).getId());
newValues.put("title", ((NewsBean) object).getTitle());
newValues.put("author", ((NewsBean) object).getAuthor());
newValues.put("image", ((NewsBean) object).getImage());
newValues.put("time", ((NewsBean) object).getTime());
newValues.put("detail", ((NewsBean) object).getDetail());
return db.insert(DB_TABLE, null, newValues);
}
Проблема заключается в том, что элементы в newValues не отображаются в качестве столбцов таблицы.Как это решить?Я не хочу менять таблицу.