我正在使用SQLite數據庫獲取表的記錄,如果存在特定的記錄。在運行應用程序時總是收到錯誤= 引起:java.lang.IllegalStateException:database/data /數據/ com.example.tazeen.xxx /數據庫/ XX(康恩#0)已關閉Android:運行時異常數據庫已關閉
dbhelper = new MyDbHelper(this);
SQLiteDatabase db1 = dbhelper.getReadableDatabase();
Cursor cursor = db1.rawQuery("select * from ActivityObjectList", null);
if (cursor.moveToFirst()) {
do {
imageName = cursor.getString(cursor.getColumnIndex("imageaudioPath"));
String strDownLoadStatus = cursor.getString(cursor.getColumnIndex("DownLoad_Status"));
} while (cursor.moveToNext());
}
cursor.close();
db1.close();
}
創建應用層上 –
數據庫實例ü可以告訴在其中一線異常拋出。 – Suru