Reputation: 2445
Is there a faster way than calling moveToNext in a loop?
Upvotes: 0
Views: 182
Reputation: 189464
As seen in the Cursor documentation there are only limited methods available to run through a cursor.
The only thing that could save some iterations of your loop is the moveToPosition method.
If you know that say the next 30 entries are not of interest you could jump ahead a bunch of positions. The real question is why are you running through the pointer?
If you query a Database and want to find a specific entry in the resulting cursors maybe you can narrow down the number of results with a more specific query.
Upvotes: 2
Reputation: 13501
Thats the only method Cursor has got... it also has other similar methods but they too will do the same.. you cannot give your own way to traverse through it.. its APK level. need to follow it..
Upvotes: 0