Take the 2-minute tour ×

I'm using a very basic example where I create a CursorLoader with a uri from my content provider and populate a map. Everything works smoothly but when I leave that activity I get a DatabaseObjectNotClosedException thrown by StrictMode. I understand that the CursorLoader deals with the Cursor so I must not close it myself. So why does this happen?

This problem doesn't appear when using a ListFragment and I guess it's because in onLoaderReset() I do adapter.swapCursor(null). But what should I do in my map fragment (or any other kind of fragment where I don't have a list) in the onLoaderReset() method? At the moment, I'm not doing anything because I don't hold a reference to the cursor returned.

share|improve this question
I get exceptions also when using ListFragment. I really don't understand why is this happening. –  kaciula Oct 13 '11 at 16:14
Is this with the Android Compatibility Library or the native Honeycomb implementation? –  CommonsWare Oct 14 '11 at 14:03
this happens with Android Compatibility Library –  Ondra Zahradnik Nov 30 '11 at 11:06

1 Answer 1

up vote 0 down vote accepted

The revision 4 of ACL fixed these issues.

share|improve this answer

Your Answer


