Код: Выделить всё
db.execSQL("create table books ("
+ "id integer primary key, "
+ "title text, "
+ "description text, "
+ "published text, "
+ "subtitle text, "
+ "author text, "
+ "free integer"
+ ");");Код: Выделить всё
obj = new DbLibray(context);
db = obj.getWritableDatabase();Код: Выделить всё
values = new ContentValues();
values.put("id", book.id);
values.put("title", book.title);
values.put("author", book.authorTitle);
values.put("free", book.free);
int t = (int) db.insert("books", null, values);
Log.d("w", "insert" + Integer.toString(t));далее пытаюсь вывести и выдает пустой список, почему?
Код: Выделить всё
String sql = "select id, title, author, free from books order by id asc;";
Cursor cursor = db.rawQuery(sql, null);
cursor.moveToFirst();
while (!cursor.isAfterLast())
{
title = cursor.getString(1);
Log.d("w", title);
cursor.moveToNext();
}