0
我試圖從數據庫中檢索所有數據,並將其放入arraylist,但我只獲得一個表的記錄。這裏是我的代碼:arraylist返回只有一個記錄
where Birthdates is arraylist.
public ArrayList<String> read()
{
Birthdates.clear();
String selectQuery = "SELECT * FROM Birthday_Reminder";
Cursor crs=database.rawQuery(selectQuery,null);
System.out.println("In read");
if(crs.moveToFirst())
{
do {
Toast.makeText(con,"adding to arraylist", Toast.LENGTH_LONG).show();
Birthdates.add(crs.getString(crs.getColumnIndex("B_Date")));
}
while (crs.moveToNext());
}
return Birthdates;
}
什麼吐司消息的數量算?它是一個嗎? – 2014-09-06 12:23:37