well, like the error says, the cursor is being garbage collected but it hadn't been closed or deactivated.

you must close your cursors!

and do it in a finally block so that they still get closed even if other code throws an exception.

for example --

Cursor c = null;

try
{
  c = resolver.query (...);

  // ...run through the query
}
finally
{
  if (c != null)
  {
    c.close ();
  }
}

not exactly like this, but you get the idea.

hth
J



Hi,

In my program i'm using sqlite database.

After using that Sqlite program when i'm using some other layout it is showing the below exception.


02-06 14:17:59.320: INFO/dalvikvm(853): Uncaught exception thrown by finalizer (will be discarded): 02-06 14:17:59.371: INFO/dalvikvm(853): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.sqlitecur...@43c4e358 on DB1 that has not been deactivated or closed 02-06 14:17:59.729: INFO/dalvikvm(853): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 02-06 14:17:59.800: INFO/dalvikvm(853): at dalvik.system.NativeStart.run(Native Method) 02-06 14:17:59.878: INFO/dalvikvm(853): Uncaught exception thrown by finalizer (will be discarded): 02-06 14:17:59.900: INFO/dalvikvm(853): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.sqlitecur...@43b9cf30 on DB2 that has not been deactivated or closed 02-06 14:17:59.909: INFO/dalvikvm(853): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 02-06 14:17:59.919: INFO/dalvikvm(853): at dalvik.system.NativeStart.run(Native Method) 02-06 14:17:59.968: INFO/dalvikvm(853): Uncaught exception thrown by finalizer (will be discarded): 02-06 14:17:59.989: INFO/dalvikvm(853): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.sqlitecur...@43b9c5e8 on null that has not been deactivated or closed 02-06 14:18:00.049: INFO/dalvikvm(853): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 02-06 14:18:00.049: INFO/dalvikvm(853): at dalvik.system.NativeStart.run(Native Method) 02-06 14:18:00.088: INFO/dalvikvm(853): Uncaught exception thrown by finalizer (will be discarded): 02-06 14:18:00.109: INFO/dalvikvm(853): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.sqlitecur...@43b95fc8 on null that has not been deactivated or closed 02-06 14:18:00.119: INFO/dalvikvm(853): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 02-06 14:18:00.140: INFO/dalvikvm(853): at dalvik.system.NativeStart.run(Native Method)


wat's this?..
how to over come this?
any one can explain me?..


--
Thanks & Regards
Sasikumar.S

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/android-developers?hl=en>http://groups.google.com/group/android-developers?hl=en


--
jason.vp.engineering.particle

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to