Как сделать базу данных контента в Android для просмотра в виде списка ??это мой код:
public void showData() {
try {
txt_diary.append("\n");
String[] field = { "recID", "date", "isi" };
Cursor c = myDb.query("diary", field, null, null, null, null,
"recID");
int theTotal = c.getCount();
Toast.makeText(getApplicationContext(), "Total diary :" + theTotal,
1).show();
int fieldID = c.getColumnIndex("recID");
int fieldDATE = c.getColumnIndex("date");
int fieldISI = c.getColumnIndex("isi");
while (c.moveToNext()) {
field[0] = Integer.toString((c.getInt(fieldID)));
field[1] = c.getString(fieldDATE);
field[2] = c.getString(fieldISI);
txt_diary.append(field[0] + " " + field[1] + " " + field[2]
+ "\n");
}
} catch (Exception e) {
Toast.makeText(getApplicationContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}