Wednesday, August 31, 2011

[android-developers] Help! Application crash while scrolling in listview

Hello,

I have a weird problem with listview, while using simplecursor
adapter. Here is the error

08-31 21:50:14.540: INFO/dalvikvm(12195): Uncaught exception thrown by
finalizer (will be discarded):
08-31 21:50:14.540: INFO/dalvikvm(12195):
java.lang.IllegalStateException: Binder has been finalized!
08-31 21:50:14.540: INFO/dalvikvm(12195): at
android.os.BinderProxy.transact(Native Method)
08-31 21:50:14.540: INFO/dalvikvm(12195): at
android.database.BulkCursorProxy.close(BulkCursorNative.java:289)
08-31 21:50:14.540: INFO/dalvikvm(12195): at
android.database.BulkCursorToCursorAdaptor.close(BulkCursorToCursorAdaptor.java:
141)
08-31 21:50:14.540: INFO/dalvikvm(12195): at
android.database.CursorWrapper.close(CursorWrapper.java:43)
08-31 21:50:14.540: INFO/dalvikvm(12195): at
android.content.ContentResolver
$CursorWrapperInner.close(ContentResolver.java:1575)
08-31 21:50:14.540: INFO/dalvikvm(12195): at
android.content.ContentResolver
$CursorWrapperInner.finalize(ContentResolver.java:1586)
08-31 21:50:14.540: INFO/dalvikvm(12195): at
dalvik.system.NativeStart.run(Native Method)

I have runQueryOnBackgroundThread implemented in my cursorAdapter,
which is invoked by the Filter.filter method call from the activity.
So I dont have any reference of the cursor in my activity. Everytime I
query I understand I get cursor changed callback in my cursor adapter,
which extends SimpleCursorAdapter

Here is how it looks

public void changeCursor(Cursor cursor) {
Log.d(TAG, "Cursor changed ... **************** "+ cursor);
if (cursor != null) {
setLoading(false);
}
super.changeCursor(cursor);
initSectionHeaders(cursor);
notifyDataSetChanged();
}

runQueryOnBackgroundThread just returns a cursor from a query.

Am I missing something, should the cursor be closed or managed
anywhere? Any help on the leads would greatly help. Thanks in advance.

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

No comments:

Post a Comment