You can't, the thread is down in the SQLite engine doing its work. I would really look at why your queries are taking so long -- 30 seconds is just insane. For example, have you created indexes on the appropriate columns for the query?
On Sat, Sep 26, 2009 at 9:16 AM, mjc147 <[email protected]> wrote: > > How to programmatically stop a long-running query? > > The long-running step is, for example, the first call to > Cursor.moveToFirst(). This can sometimes take up to 30 seconds so I > would like the user to be able to cancel. > > However, how should this be done? I've tried closing the Cursor (in > another thread) but all that happens is that the close() call takes as > long as moveToFirst() and then terminates with the exception: > > java.lang.IllegalStateException: attempt to acquire a reference on a > close SQLiteClosable > > > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

