Wednesday, October 21, 2009

[android-developers] Re: Cursor return order

Ken H wrote:
> Ok that's what I thought, thanks.
>
> Just curious, what other way is there to implement a cursor?

Cursor is just an interface. There are at least seven Cursor
implementations in Android, and creating your own is not terribly hard,
particularly if you use AbstractCursor as a base. For example, I have a
JoinCursor implementation that demonstrates creating a wrapping Cursor
that blends two data sources:

http://github.com/commonsguy/cw-advandroid/tree/master/Database/JoinCursor/

> I usually
> just load it and roll through in a do/while loop
> (moveToFirst...moveToNext that sort of thing).

That's a typical pattern for *using* a Cursor. You can also hand a
Cursor off to a CursorAdapter to display in a ListView or other form of
AdapterView.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 1.0 In Print!

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

No comments:

Post a Comment