public List<Diagnosis_tble> GetAllPatientDetails()
{
List<Diagnosis_tble> DiagnosistblList = new ArrayList<Diagnosis_tble>();
String selectQuery = "SELECT * FROM " + TABLE_Diagnosistble + "";
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = null;
{
cursor = db.rawQuery(selectQuery, null);
if(cursor.getCount() > 0)
{
if (cursor.moveToFirst())
do{
Diagnosis_tble diagCreation_tble = new Diagnosis_tble();
diagCreation_tble.SetDiagnosisID(cursor.getString(0));
diagCreation_tble.SetPName(cursor.getString(1));
diagCreation_tble.SetHospitalNo(cursor.getString(2));
diagCreation_tble.SetPGender(cursor.getString(3));
diagCreation_tble.SetPacemaker(cursor.getString(4));
diagCreation_tble.SetDiagType(cursor.getString(5));
diagCreation_tble.SetP_Age(cursor.getString(6));
diagCreation_tble.SetDeviceID(cursor.getString(7));
diagCreation_tble.SetDiagStrtTime(cursor.getString(8));
diagCreation_tble.SetDiagEndTime(cursor.getString(9));
diagCreation_tble.SetDiagStatus(cursor.getString(10));
diagCreation_tble.SetReportStatus(cursor.getString(11));
diagCreation_tble.SetUploadStatus(cursor.getString(12));
DiagnosistblList.add(diagCreation_tble);
}while (cursor.moveToNext());
return DiagnosistblList;
}else
{
return null;
}
}
finally
{
cursor.close();
}
}
这段代码有什么问题?
我得到这个例外:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.abc.TestApp/com.abc.TestApp.LoadData}:
android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.