0

我是android新手,我正在开发一个警报应用程序我在设置警报时发现了这个错误

Finalizing a Cursor that has not been deactivated or closed.
database = /data/data/com.time/databases/Salarm.db, table = ASTimer,
query = SELECT _id, description, altime, status, frequency, prealarm FROM ASTimer WHERE status='ON'

代码 :

public Cursor getAllAlarmON()
{
Log.i("alarm","Fetching records from the database...");

Cursor cursor= db.query(tableName, new String[]{"_id","description","altime","status","frequency","prealarm"}, "status='ON'", null, null, null, null);

return cursor;
4

1 回答 1

0

cursor.close()确保在关闭数据库之前关闭光标或使用startManaginCursor(cursor).


看看:finalizing-a-cursor-that-has-not-been-deactivate-or-closed-non-fatal-error

于 2012-06-10T18:09:41.070 回答