Hello,
The following function throws the exception "Uncaught exception thrown
by finalizer (will be discarded): Ljava/lang/IllegalStateException;:
Finalizing cursor android.database.sqlite.sqlitecur...@437b64a8 on
Stores that has not been deactivated or closed".
private void generateList() {
try {
listCursor = dbHelper.generateList(bundle.getString("STORE"),
bundle.getString("PERCENT"));
if(listCursor.moveToFirst())
do {
Integer quantity = listCursor.getInt(0);
String itemName = listCursor.getString(1);
ListItem listItem = new ListItem(listId,
itemName, quantity,
false);
dbHelper.insertItem(listItem);
alItems.add(listItem);
} while(listCursor.moveToNext());
} catch(Exception ex) {
ex.printStackTrace();
} finally {
if(!listCursor.isClosed() || listCursor != null) {
listCursor.deactivate();
listCursor.close();
}
}
iaList.notifyDataSetChanged();
}
The exception is usually thrown after the third time the function has
been called. LogCat shows the exception in green (Info) and does not
seem to affect performance of the app when running on ADP2 after it
has been disconnected. When the line with alItems.add(listItem) is
not commented out, the exception is not thrown. I am using Android
1.5.
Has anyone experience anything similar?
--
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