Hi Rainer, Could you provide your relevant code snippet? I am guessing you could not invalidate the cursor before using as I said earlier.
Thanks, Megha On Thu, Mar 27, 2008 at 12:01 PM, Rainer <[EMAIL PROTECTED]> wrote: > > runQuery is called by the framework (I.e. CursorAdapter). I am simply > using SimpleCursorAdapter with a FilterQueryProvider. > > cheers > - Rainer > > On Mar 27, 7:12 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > You should not be calling the runQuery() method explicitly...are you > > overriding the runQuery() method to form your own CursorAdapter? > > I am not sure how your code looks like, but before using the cursor, > you > > could use: > > > > if (cursor !=null) > > cursor.invalidate(); > > > > Thanks, > > Megha > > > > On Wed, Mar 26, 2008 at 9:23 PM, Rainer <[EMAIL PROTECTED]> wrote: > > > > > Hey > > > I have a form with an AutoCompleteTextView which is backed by a > > > SimpleCursorAdapter. My problem is that it seems that nobody closes > > > the Cursors returned by runQuery(). I dont think that I as a user of > > > SimpleCursorAdapter am responsible for closing them as there does not > > > seem to be an obvious place to do that. Also the decompliation report > > > (ups, should I say that?) of CursorAdapter seems to indicate that > > > these cursors are simply lost and never closed. The effect is that > > > after using the query feature a couple of times and dismissing the > > > Form (I guess this is then when the garbage collector starts cleaning > > > up) I get an IllegalStateException warning me that the cursor has not > > > been closed. > > > > > The documentation of SimpleCursorAdapter.runQuery does not mention > > > that the cursor must be remembered and closed. Also even if I tried > > > that, I dont find an obvious place (event) at which point it would be > > > safe to close the cursors (I would need to subclass > > > SimpleCursorAdapter or provide a FilterQueryProvider which would then > > > remember all Cursors that have been handed out and only then clean > > > them up at an appropriate time. > > > > > I honestly think this is a bug. > > > > > Any suggestions? I am so close to submitting my dev challenge project. > > > Argh. > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---