skink wrote:
> hi,
> 
> generic android.widget.Adapter iface has getCount() method which tells
> e.g. ListView how many items adapter has.
> 
> what if my Adapter's data source cannot tell me it's size and has only
> method Object getItem(int position) returning e.g. null when there is
> no item for that position?
> 
> in other words i can get some object at given position but don't know
> maximum value for position
> 
> so, is it possible to create Adapter not knowing apriori its size?

If nothing else, you can fake it. For example, you can add new data to a
MatrixCursor whenever, and a CursorAdapter will reflect the changes.

Similarly, I have an EndlessAdapter:

http://github.com/commonsguy/cwac-endless/tree/master

It wraps another adapter and makes it easier to offer an "endless" list,
where more data is loaded in when the user scrolls to the bottom.

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

Need help for your Android OSS project? http://wiki.andmob.org/hado

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to