Can you please elaborate?

Basically, what I need to do is find the row number of a particular row 
where _id = X.    Basically, I am trying to position my ListView so that 
this row is showing out of potentially thousands of rows.  

I strongly suspect there is a better way than to loop through the Cursor 
and check the_id to get its position, but I don't know what it is.  The 
order, in which, the rows are returned are user selectable -- I have 
indecies on all the sort columns.

Any ideas would be welcomed.  I, by no means, consider myself a SQL guru.



On Thursday, March 22, 2012 7:54:36 AM UTC+8, lbendlin wrote:
>
> Of course there is a faster way. Run a second query that identifies the 
> required row (make sure the condition is indexed) and throw the cursor out 
> of the window.
>
> On Wednesday, March 21, 2012 3:22:24 AM UTC-4, Zsolt Vasvari wrote:
>>
>> I run the exact same query twice in parallel:  once in the UI thread (I 
>> know I shouldn't, but it's fast) and then I run it again in the AsyncTask, 
>> this time reading through the entire cursor to find a particular row index. 
>>  (Is there a faster way to do that in SQL, btw?).
>>
>>>
>>>>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to