У меня есть tableLayout с 3 textView в TableRow.
Как добавить в TextView новые данные (1 textView = 1 name) из базы данных?
это не работает:
мой курсор говорит: выберите * из TABLE_NAME
Cursor cursor = database.query(TABLE_NAME,
new String[] {"*"},
null, null,null,null,"_id");
cursor.moveToFirst();
try {
if (!cursor.moveToFirst()) {
return;
}
do {
TextView textView = (TextView)findViewById(R.id.edit);
textView.setText(cursor.getString(0));
} while (cursor.moveToNext());
} finally {
cursor.close();
}
Мой стол:
_id student
1 Said
2 Bill
3 John
и т.д.